本文整理汇总了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());
}