diff options
Diffstat (limited to 'protected/modules/cms/models')
| -rw-r--r-- | protected/modules/cms/models/Cms.php | 3 | ||||
| -rw-r--r-- | protected/modules/cms/models/Sitecontent.php | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/protected/modules/cms/models/Cms.php b/protected/modules/cms/models/Cms.php index 691ca0c..885e589 100644 --- a/protected/modules/cms/models/Cms.php +++ b/protected/modules/cms/models/Cms.php @@ -62,9 +62,10 @@ class Cms { $sitecontent = Sitecontent::model()->findByAttributes(array('id'=> $id)); $childs = $sitecontent->childs; if($childs) { + $tmp=array(); foreach($sitecontent->childs as $child) { Yii::trace("Lala","Debug"); - $tmp = array(array('label'=>$child->title, 'url'=>array('/cms/sitecontent/view', 'page'=>$child->title_url))); + $tmp = array_merge($tmp,array(array('label'=>$child->title, 'url'=>array('/cms/sitecontent/view', 'page'=>$child->title_url)))); } } return $tmp; diff --git a/protected/modules/cms/models/Sitecontent.php b/protected/modules/cms/models/Sitecontent.php index a15029f..6d8def2 100644 --- a/protected/modules/cms/models/Sitecontent.php +++ b/protected/modules/cms/models/Sitecontent.php @@ -27,11 +27,11 @@ class Sitecontent extends CActiveRecord public function rules() { return array( - array('id, position, title, language', 'required'), + array('position, title, language', 'required'), array('parent, position, createtime, updatetime', 'numerical', 'integerOnly'=>true), array('title, keywords, description', 'length', 'max'=>255), array('content, title_url, title_browser', 'safe'), - array('id, position, title, keywords, description, content, authorid, createtime, updatetime, language', 'safe', 'on'=>'search'), + array('title, keywords, description, content, language', 'safe', 'on'=>'search'), ); } |
