File indexing completed on 2024-06-23 05:55:57

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_View
0017  * @subpackage Helper
0018  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0019  * @version    $Id$
0020  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0021  */
0022 
0023 /** Zend_View_Helper_Abstract.php */
0024 // require_once 'Zend/View/Helper/Abstract.php';
0025 
0026 /**
0027  * Renders a template and stores the rendered output as a placeholder
0028  * variable for later use.
0029  *
0030  * @package    Zend_View
0031  * @subpackage Helper
0032  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0033  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0034  */
0035 
0036 class Zend_View_Helper_RenderToPlaceholder extends Zend_View_Helper_Abstract
0037 {
0038 
0039     /**
0040      * Renders a template and stores the rendered output as a placeholder
0041      * variable for later use.
0042      *
0043      * @param string $script The template script to render
0044      * @param string $placeholder The placeholder variable name in which to store the rendered output
0045      * @return void
0046      */
0047     public function renderToPlaceholder($script, $placeholder)
0048     {
0049         $this->view->placeholder($placeholder)->captureStart();
0050         echo $this->view->render($script);
0051         $this->view->placeholder($placeholder)->captureEnd();
0052     }
0053 }