本文整理汇总了PHP中Zend_Layout::setOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Layout::setOptions方法的具体用法?PHP Zend_Layout::setOptions怎么用?PHP Zend_Layout::setOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Layout
的用法示例。
在下文中一共展示了Zend_Layout::setOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startMvc
/**
* Static method for initialization with MVC support
*
* @param string|array|Zend_Config $options
* @return Zend_Layout
*/
public static function startMvc($options = null)
{
if (null === self::$_mvcInstance) {
self::$_mvcInstance = new self($options, true);
} else {
self::$_mvcInstance->setOptions($options);
}
return self::$_mvcInstance;
}
示例2: startMvc
/**
* Static method for initialization with MVC support
*
* @param string|array|Zend_Config $options
* @return Zend_Layout
*/
public static function startMvc($options = null)
{
if (null === self::$_mvcInstance) {
self::$_mvcInstance = new self($options, true);
} else {
if (is_string($options)) {
self::$_mvcInstance->setLayoutPath($options);
} elseif (is_array($options) || $options instanceof Zend_Config) {
self::$_mvcInstance->setOptions($options);
}
}
return self::$_mvcInstance;
}
示例3: testSetOptionsWithConfigObjectModifiesAttributes
/**
* @return void
*/
public function testSetOptionsWithConfigObjectModifiesAttributes()
{
$layout = new Zend_Layout();
$config = new Zend_Config(array('layout' => 'foo', 'contentKey' => 'foo', 'layoutPath' => dirname(__FILE__), 'mvcEnabled' => false));
$layout->setOptions($config);
$this->assertEquals('foo', $layout->getLayout());
$this->assertEquals('foo', $layout->getContentKey());
$this->assertEquals(dirname(__FILE__), $layout->getLayoutPath());
$this->assertFalse($layout->getMvcEnabled());
}