isDispatched example


    public function shouldRender()
    {
        return $this->Front() !== null
            && !$this->Front()->getParam('noViewRenderer')
            && !$this->neverRender
            && !$this->noRender
            && $this->Action() !== null
            && $this->Action()->Request()->isDispatched()
            && !$this->Action()->Response()->isRedirect()
        ;
    }

    /** * Getter function of the front property. * * @return Enlight_Controller_Front */
    public function Front()
    {
        

    public function onPostDispatch(Enlight_Event_EventArgs $args)
    {
        /** @var Enlight_Controller_Action $subject */
        $subject = $args->getSubject();

        $request = $subject->Request();
        $response = $subject->Response();

        if (!$request->isDispatched() || $response->isException() || $request->getModuleName() !== 'frontend') {
            return;
        }

        $id = (int) $subject->Request()->getParam('sArticle');
        $view = $subject->View();
        /** @var SessionInterface $session */
        $session = $this->get('session');

        $sArticle = $view->getAssign('sArticle');

        $notificationVariants = [];

        

    public function onPostDispatch(Enlight_Event_EventArgs $args)
    {
        $subject = $args->get('subject');
        if (!$subject instanceof Enlight_Controller_Action) {
            return;
        }

        $response = $subject->Response();
        $request = $subject->Request();

        if (!$request->isDispatched()) {
            return;
        }

        // If the attribute padding is a boolean true         if ($this->padding === true) {
            $this->padding = $request->getParam('callback');
            $this->padding = preg_replace('#[^0-9a-z_]+#i', '', (string) $this->padding);
        }

        // decide if we should render the data or the whole page         if ($this->renderer === true) {
            
__CLASS__ . '_PreDispatch_' . $moduleName,
            $args
        );

        Shopware()->Events()->notify(
            __CLASS__ . '_PreDispatch_' . $this->controller_name,
            $args
        );

        $this->preDispatch();

        if ($this->Request()->isDispatched() && !$this->Response()->isRedirect()) {
            $action_name = $this->Front()->Dispatcher()->getFullActionName($this->Request());

            if (!$event = Shopware()->Events()->notifyUntil(__CLASS__ . '_' . $action_name$args)) {
                $this->$action(...$this->getActionArguments($action));
            }

            $this->postDispatch();
        }

        // Fire "Secure"-PostDispatch-Events only if:         // - Request is Dispatched


    /** * Optimize Sourcecode / Apply SEO rules */
    public function onPostDispatch(Enlight_Controller_ActionEventArgs $args)
    {
        $request = $args->getSubject()->Request();
        $response = $args->getSubject()->Response();
        $view = $args->getSubject()->View();

        if (!$request->isDispatched() || $response->isException()
            || $request->getModuleName() !== 'frontend'
            || !$view->hasTemplate()
        ) {
            return;
        }

        $config = $this->get(Shopware_Components_Config::class);

        /** @var QueryAliasMapper $mapper */
        $mapper = $this->get(QueryAliasMapper::class);

        
    $request->setParam('_isSubrequest', true);
    $request->setAttribute('_isSubrequest', true);

    $request->setActionName(isset($params['action']) ? $params['action'] : 'index');
    $request->setParams($params)
            ->setDispatched(true);

    Shopware()->Container()->get('request_stack')->push($request);

    $dispatcher->dispatch($request$response);

    if (!$request->isDispatched() || $response->isRedirect()) {
        // forwards and redirects render nothing         return '';
    }

    $return = $response->getBody();

    return $return;
}
return '<esi:include src="' . $url . '" />';
    }

    /** * On post dispatch we try to find affected articleIds displayed during this request * * @return void */
    public function onPostDispatch(Enlight_Controller_ActionEventArgs $args)
    {
        $view = $args->getSubject()->View();
        if (!$this->request->isDispatched()
            || $this->response->isException()
            || !$view->hasTemplate()
        ) {
            return;
        }

        if (!$this->hasSurrogateEsiCapability($this->request)) {
            return;
        }

        if ($this->request->getModuleName() !== 'frontend' && $this->request->getModuleName() !== 'widgets') {
            

            try {
                $this->eventManager->notify(
                    'Enlight_Controller_Front_PreDispatch',
                    $eventArgs
                );

                /* * Skip requested action if preDispatch() has reset it */
                if (!$this->ensureRequest()->isDispatched()) {
                    continue;
                }

                /* * Dispatch request */
                $this->Dispatcher()->dispatch($this->ensureRequest()$this->Response());
            } catch (Exception $e) {
                if ($this->throwExceptions()) {
                    throw $e;
                }
                


    /** * @return void */
    public function onPostDispatch(Enlight_Event_EventArgs $args)
    {
        $view = $args->getSubject()->View();
        $request = $args->getSubject()->Request();
        $response = $args->getSubject()->Response();

        if (!$request->isDispatched()
            || $response->isException()
            || $request->getModuleName() !== 'frontend'
        ) {
            return;
        }

        $config = $this->Config();
        if (empty($config->show)) {
            return;
        }

        

    public function onPostDispatch(Enlight_Event_EventArgs $args)
    {
        $request = $args->getSubject()->Request();
        $response = $args->getSubject()->Response();

        /** @var Enlight_View_Default $view */
        $view = $args->getSubject()->View();

        if (!$request->isDispatched() || $response->isException()
            || $request->getModuleName() !== 'frontend'
            || !$view->hasTemplate()
        ) {
            return;
        }

        $view->assign('baseUrl', $request->getBaseUrl() . $request->getPathInfo());

        $shop = Shopware()->Shop();
        $view->assign('Controller', $args->getSubject()->Request()->getControllerName());

        
Home | Imprint | This part of the site doesn't use cookies.