Issues

ZF-2814: Create View Helper to Render code into a placeholder

Description

Another thing you could do is create your own helper -- let's call it 'renderToPlaceholder'. It could work like this:


    <? $this->renderToPlaceholder('account/_signin_side.phtml', 'RIGHTBAR') ?>

and internally have code something like this:


    class My_View_Helper_RenderToPlaceholder
    {
        public $view;

        public function setView(Zend_View_Interface $view)
        {
            $this->view = $view;
        }

        public function renderToPlaceholder($script, $placeholder)
        {
            $this->view->placeholder($placeholder)->captureStart();
            echo $this->view->render($script);
            $this->view->placeholder($placeholder)->captureEnd();
        }
    }

Place it in your helper path:


    $view->addHelperPath('My/View/Helper/', 'My_View_Helper');

and you'd be good to go.

Comments

Please categorize/fix as needed.

I created this issue for Matthew. He would know more about it than I do. It was from the mailing list.

Scheduling for next minor release (new functionality)

Resolved at r10747 in trunk. Resolved at r10748 in release 1.6 branch.

Updating for the 1.6.0 release.