本文整理匯總了PHP中Zend\Layout\Layout::setOptions方法的典型用法代碼示例。如果您正苦於以下問題:PHP Layout::setOptions方法的具體用法?PHP Layout::setOptions怎麽用?PHP Layout::setOptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend\Layout\Layout
的用法示例。
在下文中一共展示了Layout::setOptions方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testSetOptionsWithConfigObjectModifiesAttributes
public function testSetOptionsWithConfigObjectModifiesAttributes()
{
$layout = new Layout\Layout();
$config = new Config\Config(array('layout' => 'foo', 'contentKey' => 'foo', 'layoutPath' => __DIR__));
$layout->setOptions($config);
$this->assertEquals('foo', $layout->getLayout());
$this->assertEquals('foo', $layout->getContentKey());
$this->assertEquals(__DIR__, $layout->getLayoutPath());
}
示例2: startMvc
/**
* Static method for initialization with MVC support
*
* @param string|array|\Zend\Config\Config $options
* @return \Zend\Layout\Layout
*/
public static function startMvc($options = null)
{
if (null === self::$_mvcInstance) {
self::$_mvcInstance = new self($options, true);
}
if (is_string($options)) {
self::$_mvcInstance->setLayoutPath($options);
} elseif (is_array($options) || $options instanceof Config\Config) {
self::$_mvcInstance->setOptions($options);
}
return self::$_mvcInstance;
}
示例3: testSetOptionsWithConfigObjectModifiesAttributes
/**
* @return void
*/
public function testSetOptionsWithConfigObjectModifiesAttributes()
{
$layout = new Layout\Layout();
$config = new Config\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());
}