Issues

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

Issue Type: New Feature Created: 2008-03-06T14:12:03.000+0000 Last Updated: 2008-09-02T10:39:02.000+0000 Status: Resolved Fix version(s): - 1.6.0 (02/Sep/08)

Reporter: Jon Whitcraft (sidhighwind) Assignee: Ralph Schindler (ralph) Tags: - Zend_View

Related issues: Attachments:

Description

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

<pre class="highlight">
    <? $this->renderToPlaceholder('account/_signin_side.phtml', 'RIGHTBAR') ?>

and internally have code something like this:

<pre class="highlight">
    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:

<pre class="highlight">
    $view->addHelperPath('My/View/Helper/', 'My_View_Helper');

and you'd be good to go.

Comments

Posted by Wil Sinclair (wil) on 2008-03-25T20:33:29.000+0000

Please categorize/fix as needed.

Posted by Jon Whitcraft (sidhighwind) on 2008-03-26T13:25:37.000+0000

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

Posted by Matthew Weier O'Phinney (matthew) on 2008-05-09T12:42:20.000+0000

Scheduling for next minor release (new functionality)

Posted by Ralph Schindler (ralph) on 2008-08-06T23:13:15.000+0000

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

Posted by Wil Sinclair (wil) on 2008-09-02T10:39:02.000+0000

Updating for the 1.6.0 release.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts