本文整理汇总了PHP中Cake\Controller\Component::config方法的典型用法代码示例。如果您正苦于以下问题:PHP Component::config方法的具体用法?PHP Component::config怎么用?PHP Component::config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Controller\Component
的用法示例。
在下文中一共展示了Component::config方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* Initialize method
*
* @param Component $component Component instance.
* @return void
*/
public function initialize(Component $component)
{
$adapter = $component->config('adapter');
if (is_array($adapter)) {
$this->options = $adapter + $this->options;
}
$engine = new IniConfig(dirname($this->options['config']) . DS);
$this->options = $engine->read(basename($this->options['config']));
}
示例2: initialize
/**
* Initialize method
*
* @param Component $Component Component instance
* @return void
*/
public function initialize(Component $Component)
{
$adapter = $Component->config('adapter');
if (is_array($adapter)) {
$this->options = $adapter + $this->options;
}
$engine = new PhpConfig(dirname($this->options['config']) . DS);
$config = $engine->read(basename($this->options['config']));
$this->build($config);
$Component->Aco = $this->Aco;
$Component->Aro = $this->Aro;
}