shouldRender example


    }

    /** * Listener method of the Enlight_Controller_Action_PostDispatch event. * If the current view instance has a template and the template should be rendered, * the template renders and the view template of the Enlight_Controller_Action * initials. */
    public function onPostDispatch(Enlight_Event_EventArgs $args)
    {
        if ($this->shouldRender() && $this->Action()->View()->hasTemplate()) {
            $this->render();
        }
        $this->setNoRender(false);
    }

    /** * Listener method of the Enlight_Controller_Action_PreDispatch event. * If the current view instance has a template and the template should be rendered, * the template is loaded by name. */
    public function onPreDispatch(Enlight_Event_EventArgs $args)
    {

    public function onPreDispatch(Enlight_Event_EventArgs $args)
    {
        if (!$this->render) {
            return;
        }

        $this->render = false;

        if ($this->viewRenderer->Action()->View()->hasTemplate()
            || !$this->viewRenderer->shouldRender()
        ) {
            return;
        }

        $template = $this->getTemplateName();
        if ($template === null) {
            return;
        }

        $this->viewRenderer->Action()->View()->loadTemplate($template);

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