File indexing completed on 2025-03-02 05:29:59
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_Placeholder_Registry */ 0024 // require_once 'Zend/View/Helper/Placeholder/Registry.php'; 0025 0026 /** Zend_View_Helper_Abstract.php */ 0027 // require_once 'Zend/View/Helper/Abstract.php'; 0028 0029 /** 0030 * Helper for passing data between otherwise segregated Views. It's called 0031 * Placeholder to make its typical usage obvious, but can be used just as easily 0032 * for non-Placeholder things. That said, the support for this is only 0033 * guaranteed to effect subsequently rendered templates, and of course Layouts. 0034 * 0035 * @package Zend_View 0036 * @subpackage Helper 0037 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0038 * @license http://framework.zend.com/license/new-bsd New BSD License 0039 */ 0040 class Zend_View_Helper_Placeholder extends Zend_View_Helper_Abstract 0041 { 0042 /** 0043 * Placeholder items 0044 * @var array 0045 */ 0046 protected $_items = array(); 0047 0048 /** 0049 * @var Zend_View_Helper_Placeholder_Registry 0050 */ 0051 protected $_registry; 0052 0053 /** 0054 * Constructor 0055 * 0056 * Retrieve container registry from Zend_Registry, or create new one and register it. 0057 * 0058 * @return void 0059 */ 0060 public function __construct() 0061 { 0062 $this->_registry = Zend_View_Helper_Placeholder_Registry::getRegistry(); 0063 } 0064 0065 0066 /** 0067 * Placeholder helper 0068 * 0069 * @param string $name 0070 * @return Zend_View_Helper_Placeholder_Container_Abstract 0071 */ 0072 public function placeholder($name) 0073 { 0074 $name = (string) $name; 0075 return $this->_registry->getContainer($name); 0076 } 0077 0078 /** 0079 * Retrieve the registry 0080 * 0081 * @return Zend_View_Helper_Placeholder_Registry 0082 */ 0083 public function getRegistry() 0084 { 0085 return $this->_registry; 0086 } 0087 }