本文整理汇总了PHP中CMap::mergearray方法的典型用法代码示例。如果您正苦于以下问题:PHP CMap::mergearray方法的具体用法?PHP CMap::mergearray怎么用?PHP CMap::mergearray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMap
的用法示例。
在下文中一共展示了CMap::mergearray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processRules
/**
* Overrides processRules, allowing us to inject our own ruleset into the URL Manager
* Takes no parameters
**/
protected function processRules()
{
$this->cache = !YII_DEBUG;
// Generate the clientRules
$this->rules = $this->cache ? Yii::app()->cache->get('CiiMS::Routes') : array();
if ($this->rules == false || empty($this->rules)) {
$this->rules = array();
$this->rules = $this->generateClientRules();
$this->rules = CMap::mergearray($this->addRssRules(), $this->rules);
$this->rules = CMap::mergeArray($this->addModuleRules(), $this->rules);
Yii::app()->cache->set('CiiMS::Routes', $this->rules);
}
// Append our cache rules BEFORE we run the defaults
$this->rules['<controller:\\w+>/<action:\\w+>/<id:\\d+>'] = '<controller>/<action>';
$this->rules['<controller:\\w+>/<action:\\w+>'] = '<controller>/<action>';
return parent::processRules();
}