CDbException

数据库中无法找到 active record class "Layout" 对应的 table "layout".

/websites/html/protected/framework/db/ar/CActiveRecord.php(2312)

2300     private $_model;
2301 
2302     /**
2303      * Constructor.
2304      * @param CActiveRecord $model the model instance
2305      */
2306     public function __construct($model)
2307     {
2308         $this->_model=$model;
2309 
2310         $tableName=$model->tableName();
2311         if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2312             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2313                 array('{class}'=>get_class($model),'{table}'=>$tableName)));
2314         if($table->primaryKey===null)
2315         {
2316             $table->primaryKey=$model->primaryKey();
2317             if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2318                 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2319             else if(is_array($table->primaryKey))
2320             {
2321                 foreach($table->primaryKey as $name)
2322                 {
2323                     if(isset($table->columns[$name]))
2324                         $table->columns[$name]->isPrimaryKey=true;

Stack Trace

#1
+
 /websites/html/protected/modules/wfcms/models/Layout.php(21): CActiveRecord::model("Layout")
16      * @param string $className active record class name.
17      * @return Layout the static model class
18      */
19     public static function model($className=__CLASS__)
20     {
21         return parent::model($className);
22     }
23 
24     /**
25      * @return string the associated database table name
26      */
#2
+
 /websites/html/protected/modules/wfcms/LayoutWidget.php(27): Layout::model()
22     {
23       $model=$this->model;
24     }elseif (isset($this->id)){
25       $model=Layout::model()->findByPk($this->id);
26     }elseif(isset($this->keyword)){
27       $model=Layout::model()->findByAttributes(array('keyword'=>$this->keyword));
28     }
29     if ($model){
30       $this->inline_edit($model);    
31       echo "<div class='layout-area'>{$model->content}</div>";
32     }
#5
+
 /websites/html/themes/basic/views/site/index.php(35): CBaseController->widget("wfcms.LayoutWidget", array("keyword" => "s_section1_img"))
30        
31     </div>
32 
33     <div class="s_section1">
34         <div class="center">
35              <?php  $this->widget('wfcms.LayoutWidget',array('keyword'=>'s_section1_img'));  ?>
36         </div>
37     </div>
38 
39     <div class="s_section2">
40         <div class="pic_img">
2025-12-21 07:52:17 Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 PHP/5.4.16 mod_wsgi/3.4 Python/2.7.5 Yii Framework/1.1.12
临安民宿  南海实业  店铺优化  美达电器  银杏园林  蚂蚁搬家  绿荒环保  整体卫浴  网络科技  道安美物流