setNoRender example

$this->View()->assign([
            'success' => true,
            'data' => $this->Request()->getParams(),
        ]);
    }

    /** * Validates the inserted email address */
    public function validateEmailAction()
    {
        Shopware()->Front()->Plugins()->ViewRenderer()->setNoRender();

        $mail = $this->Request()->get('value');

        $query = $this->getRepository()->getValidateEmailQuery(
            $mail,
            $this->Request()->get('param'),
            $this->Request()->get('subshopId')
        );

        $customer = $query->getArrayResult();

        
class Shopware_Controllers_Frontend_Error extends Enlight_Controller_Action implements CSRFWhitelistAware
{
    /** * Disable front plugins * * @return void */
    public function init()
    {
        $this->Front()->Plugins()->ScriptRenderer()->setRender(false);
        $this->Front()->Plugins()->ViewRenderer()->setNoRender(false);
        $this->Front()->Plugins()->Json()->setRenderer(false);
    }

    /** * Load correct template */
    public function preDispatch()
    {
        if ($this->Request()->getActionName() === 'service') {
            return;
        }
        

    public static $testRepository;

    /** * Disable template engine for all actions and enable JSON Render - spare index and load action * * @codeCoverageIgnore */
    public function preDispatch()
    {
        Shopware()->Front()->Plugins()->ViewRenderer()->setNoRender();
    }

    /** * Tracks how many clicks on a single banner are clicked. * If we have a valid link this action will redirect the browser accordingly * * @return bool */
    public function countBannerClickAction()
    {
        $bannerId = $this->Request()->getParam('bannerId');
        

    public function preDispatch()
    {
        $this->Response()->setHeader('x-robots-tag', 'noindex');
    }

    public function serviceAction()
    {
        $this->Response()->setStatusCode(503);

        // do not render a template when in service mode         $this->Front()->Plugins()->ViewRenderer()->setNoRender(true);
    }
}

    public function ajaxAmountAction()
    {
        $this->Response()->headers->set('content-type', 'application/json');

        $amount = $this->basket->sGetAmount();
        $quantity = $this->basket->sCountBasket();

        $this->View()->assign('sBasketQuantity', $quantity);
        $this->View()->assign('sBasketAmount', empty($amount) ? 0 : array_shift($amount));

        $this->Front()->Plugins()->ViewRenderer()->setNoRender();

        $this->Response()->setContent(
            json_encode([
                'amount' => Shopware()->Template()->fetch('frontend/checkout/ajax_amount.tpl'),
                'quantity' => $quantity,
            ])
        );
    }

    /** * Sets a temporary session variable which holds an address for the current order * * @return void */
$this->privateFilesystemRoot = $privateFilesystemRoot;
        $this->unitTestMode = $unitTestMode;
    }

    /** * {@inheritdoc} * * @throws FileNotFoundException */
    public function send(string $location, FilesystemInterface $filesystem): void
    {
        $this->front->Plugins()->ViewRenderer()->setNoRender();
        $downloadStrategy = (int) $this->config->get('esdDownloadStrategy');

        $meta = $filesystem->getMetadata($location);
        $mimeType = $filesystem->getMimetype($location) ?: 'application/octet-stream';

        $response = $this->front->Response();

        if ($this->canServedLocal($filesystem$downloadStrategy)) {
            $publicUrl = $this->publicUrlGenerator->generateUrl($location);
            $path = (string) parse_url($publicUrl, PHP_URL_PATH);
            switch ($downloadStrategy) {
                

    /** * Pre dispatch method */
    public function preDispatch()
    {
        $this->Response()->setHeader('x-robots-tag', 'noindex');
    }

    public function refreshCaptchaAction()
    {
        $this->Front()->Plugins()->ViewRenderer()->setNoRender();

        $legacyCaptcha = $this->container->get('shopware.captcha.legacy_captcha');
        $templateData = $legacyCaptcha->getTemplateData();

        $img = $templateData['img'];
        $rand = $templateData['sRand'];

        $body = '<img src="data:image/png;base64,' . $img . '" alt="Captcha" />';
        $body .= '<input type="hidden" name="sRand" value="' . $rand . '" />';

        $this->Response()->setContent($body);
    }
return [
            'downloadLogFile',
        ];
    }

    /** * Disable template engine for some actions */
    public function preDispatch()
    {
        if ($this->Request()->getActionName() === 'downloadLogFile') {
            $this->Front()->Plugins()->ViewRenderer()->setNoRender();
        } elseif (!\in_array($this->Request()->getActionName()['index', 'load'])) {
            $this->Front()->Plugins()->Json()->setRenderer();
        }
    }

    /** * This function is called, when the user opens the log-module. * It reads the logs from s_core_log * Additionally it sets a filterValue * * @return void */
$this->View()->assign('isShipping', $this->isShippingRequest());
    }

    /** * Saves a new address and returns an envelope containing success and error indicators * * In addition, extraData[] can be send to do various actions after saving. See handleExtraData() for more * information. */
    public function ajaxSaveAction()
    {
        $this->Front()->Plugins()->ViewRenderer()->setNoRender();
        $response = ['success' => true, 'errors' => [], 'data' => []];

        $userId = $this->get('session')->get('sUserId');
        $addressId = $this->Request()->getPost('id');
        $extraData = $this->Request()->getParam('extraData', []);

        if ($this->Request()->getParam('saveAction') === 'update') {
            $address = $this->addressRepository->getOneByUser($addressId$userId);
        } else {
            $address = new Address();
        }

        
array_merge(['optinconfirmed' => true]$redirection)
        );
    }

    /** * @throws Exception * * @deprecated since 5.7.4. Will be removed in Shopware 5.8 without replacement */
    public function ajaxValidateEmailAction()
    {
        $this->Front()->Plugins()->ViewRenderer()->setNoRender();
        $this->Response()->setHttpResponseCode(Response::HTTP_GONE);
    }

    public function ajaxValidatePasswordAction()
    {
        Shopware()->Front()->Plugins()->ViewRenderer()->setNoRender();

        $data = $this->getPostData();
        $customerForm = $this->createCustomerForm($data['register']['personal']);

        $errors = $this->getFormErrors($customerForm);
        
/** * Disable template engine for all actions * * @codeCoverageIgnore */
    public function preDispatch()
    {
        parent::preDispatch();
        if (\in_array($this->Request()->getActionName()[
            'validateOrderCode', 'validateVoucherCode', 'validateDescription', ])) {
            $this->Front()->Plugins()->Json()->setRenderer(false);
            $this->Front()->Plugins()->ViewRenderer()->setNoRender();
        }
    }

    /** * Deletes a Supplier from the database * * @return void */
    public function deleteVoucherAction()
    {
        $multipleVouchers = $this->Request()->getPost('vouchers');
        
use Shopware\Components\CSRFTokenValidator;
use Shopware\Components\Random;

class Shopware_Controllers_Frontend_Csrftoken extends Enlight_Controller_Action
{
    /** * Loads auth and script renderer resource */
    public function preDispatch()
    {
        $this->Front()->Plugins()->ViewRenderer()->setNoRender();
    }

    /** * Generates a token and fills the cookie and session * * @return void */
    public function indexAction()
    {
        $token = Random::getAlphanumericString(30);

        
'total' => 1,
        ]);
    }

    /** * Exports emotion data and assets to zip archive * * @return void */
    public function exportAction()
    {
        $this->Front()->Plugins()->ViewRenderer()->setNoRender();
        $this->Front()->Plugins()->Json()->setRenderer(false);

        $emotionId = $this->Request()->get('emotionId');

        if (!$emotionId) {
            echo 'Parameter emotionId not found!';

            return;
        }

        $exporter = $this->container->get('shopware.emotion.emotion_exporter');

        
$this->View()->assign(['success' => true, 'data' => $data]);
        } catch (Exception $e) {
            $this->View()->assign(['success' => false, 'errorMsg' => $e->getMessage()]);
        }
    }

    /** * Function to check if an product exists or is already added as a premium-product */
    public function validateArticleAction()
    {
        Shopware()->Front()->Plugins()->ViewRenderer()->setNoRender();
        $value = trim($this->Request()->get('value'));

        // Is there a value in the textfield?         if ($value == null) {
            return;
        }

        // If the product exists         $repository = $this->get('models')->getRepository(Detail::class);
        $result = $repository->findOneBy(['number' => $value]);

        
class Shopware_Controllers_Backend_Newsletter extends Enlight_Controller_Action implements CSRFWhitelistAware
{
    /** * Init controller method * * Disables the authorization-checking and template renderer. */
    public function init()
    {
        Shopware()->Plugins()->Backend()->Auth()->setNoAuth();
        Shopware()->Front()->Plugins()->ViewRenderer()->setNoRender();
    }

    /** * {@inheritdoc} */
    public function getWhitelistedCSRFActions()
    {
        return [
            'view',
            'index',
            'cron',
            
Home | Imprint | This part of the site doesn't use cookies.