<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect3 id="zend.view.helpers.initial.rendertoplaceholder">
    <title>RenderToPlaceholder Helper</title>

    <para>
        Renders a template (view script) and stores the rendered output as a
        placeholder variable for later use.
    </para>

    <note role="info">
        <para>
            The helper uses the <link linkend="zend.view.helpers.initial.placeholder">Placeholder helper</link>
            and his <link linkend="zend.view.helpers.initial.placeholder.capture">Capture methods</link>.
        </para>
    </note>

    <example id="zend.view.helpers.initial.rendertoplaceholder.usage">
        <title>Basic Usage of RenderToPlaceholder</title>

<programlisting language="php"><![CDATA[
<?php
// View script (backlink.phtml):
echo sprintf(
    '<p class="older"><a href="%s">Older posts</a></p>',
    $this->url(array('controller' => 'index', 'action' => 'index'))
)
?>

<?php
// Usage:
$this->renderToPlaceholder('backlink.phtml', 'link');
?>

<?php
echo $this->placeholder('link');
// Output: <p class="older"><a href="index/index">Older posts</a></p>
?>
]]></programlisting>
    </example>

</sect3>