本文整理汇总了PHP中Zend_View_Helper_Placeholder_Registry::getRegistry方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Helper_Placeholder_Registry::getRegistry方法的具体用法?PHP Zend_View_Helper_Placeholder_Registry::getRegistry怎么用?PHP Zend_View_Helper_Placeholder_Registry::getRegistry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View_Helper_Placeholder_Registry
的用法示例。
在下文中一共展示了Zend_View_Helper_Placeholder_Registry::getRegistry方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*/
public function __construct($config = array(), $translate = null)
{
parent::__construct($config);
$this->_translate = $translate;
$this->_placeholderRegistry = Zend_View_Helper_Placeholder_Registry::getRegistry();
if (array_key_exists('use_module_cache', $config) && (bool) $config['use_module_cache']) {
$this->_moduleCache = OntoWiki::getInstance()->getCache();
}
}
示例2: testNamespaceRegisteredInPlaceholderRegistryAfterInstantiation
public function testNamespaceRegisteredInPlaceholderRegistryAfterInstantiation()
{
$registry = Zend_View_Helper_Placeholder_Registry::getRegistry();
if ($registry->containerExists('Zend_View_Helper_HeadMeta')) {
$registry->deleteContainer('Zend_View_Helper_HeadMeta');
}
$this->assertFalse($registry->containerExists('Zend_View_Helper_HeadMeta'));
$helper = new Zend_View_Helper_HeadMeta();
$this->assertTrue($registry->containerExists('Zend_View_Helper_HeadMeta'));
}
示例3: renderAdmin
public function renderAdmin($name, $placeholderName = 'content', $model = null)
{
$result = $this->view->placeholder($placeholderName)->toString();
if ($this->_access()) {
if (sizeof($model)) {
foreach ($model as $k => $v) {
$this->view->{$k} = $v;
}
}
$this->view->content = $result;
$result = $this->view->render($name);
}
Zend_View_Helper_Placeholder_Registry::getRegistry()->deleteContainer($placeholderName);
return $result;
}
示例4: wrap
/**
* Обрамляем текуший текст шаблоном
*
* @param string $text
* @return string
*/
public function wrap($name, $function = false, $placeholderName = 'body', $model = null)
{
if ('content_item' == $placeholderName || 'content' == $placeholderName) {
$this->view->placeholder($placeholderName)->captureStart();
$function();
$this->view->placeholder($placeholderName)->captureEnd();
return $this->view->renderAdmin($name, $placeholderName, $model);
}
$return = $resultEcho = false;
if (is_callable($function)) {
$this->view->placeholder($placeholderName)->captureStart();
$return = $function();
$this->view->placeholder($placeholderName)->captureEnd();
$resultEcho = $this->view->placeholder($placeholderName)->toString();
Zend_View_Helper_Placeholder_Registry::getRegistry()->deleteContainer($placeholderName);
}
$this->view->{$placeholderName} = $return ? $return : $resultEcho;
$return = $this->view->render($name);
unset($this->view->{$placeholderName});
return $return;
}
示例5: _initVarContainer
/**
* Initialize placeholder container for layout vars
*
* @return Zend_View_Helper_Placeholder_Container
*/
protected function _initVarContainer()
{
if (null === $this->_container) {
require_once 'Zend/View/Helper/Placeholder/Registry.php';
$this->_container = Zend_View_Helper_Placeholder_Registry::getRegistry()->getContainer(__CLASS__);
}
return $this->_container;
}
示例6: __construct
/**
* Constructor
*
* Retrieve container registry from Zend_Registry, or create new one and register it.
*
* @return void
*/
public function __construct()
{
$this->_registry = Zend_View_Helper_Placeholder_Registry::getRegistry();
}
示例7: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
$this->setRegistry(Zend_View_Helper_Placeholder_Registry::getRegistry());
$registry = $this->getRegistry();
$this->setContainer($this->getRegistry()->getContainer($this->_regKey));
}
示例8: testGetRegistryRegistersWithGlobalRegistry
public function testGetRegistryRegistersWithGlobalRegistry()
{
$this->assertFalse(Zend_Registry::isRegistered(Zend_View_Helper_Placeholder_Registry::REGISTRY_KEY));
$registry = Zend_View_Helper_Placeholder_Registry::getRegistry();
$this->assertTrue(Zend_Registry::isRegistered(Zend_View_Helper_Placeholder_Registry::REGISTRY_KEY));
$registered = Zend_Registry::get(Zend_View_Helper_Placeholder_Registry::REGISTRY_KEY);
$this->assertSame($registry, $registered);
}
示例9: _initVarContainer
/**
* Initialize placeholder container for layout vars
*
* @return Zend_View_Helper_Placeholder_Container
*/
protected function _initVarContainer()
{
if (null === $this->_container) {
$this->_container = Zend_View_Helper_Placeholder_Registry::getRegistry()->getContainer(__CLASS__);
}
return $this->_container;
}
示例10: testSetMetaCharsetShouldOnlyAvailableForHtml5
/**
* @group ZF-10343
*/
public function testSetMetaCharsetShouldOnlyAvailableForHtml5()
{
$charset = 'UTF-8';
$options = array('doctype' => 'XHTML1_STRICT', 'charset' => $charset);
$resource = new Zend_Application_Resource_View($options);
$view = $resource->init();
$headMetaHelper = $view->headMeta();
$actual = null;
$container = $headMetaHelper->getContainer();
foreach ($container as $item) {
if ('charset' == $item->type) {
$actual = $item->charset;
break;
}
}
$this->assertFalse($view->doctype()->isHtml5());
$this->assertNull($actual);
$registry = Zend_View_Helper_Placeholder_Registry::getRegistry();
$registry->deleteContainer('Zend_View_Helper_HeadMeta');
$registry->deleteContainer('Zend_View_Helper_Doctype');
}