Ejemplo n.º 1
0
 function init()
 {
     parent::init();
     $q = $_GET['q'];
     $model = "\\Content\\{$q}";
     $this->obj = new $model();
     $this->data['fields'] = $this->obj->fields;
     $allowFields = ['title', 'status'];
     $int = ['status'];
     foreach ($this->data['fields'] as $k => $v) {
         $allowFields[] = $k;
         if ($v['int'] === true) {
             $int[] = $k;
         }
     }
     /**
      * 允许保存到数据库的字段
      * @var array $allowFields
      */
     $this->obj->allowFields = $allowFields;
     $this->obj->int = $int;
     $this->jump = url($this->jump, $_GET);
     $this->data['type'] = $this->obj->title;
 }
Ejemplo n.º 2
0
 function init()
 {
     parent::init();
     $this->obj = new PostModel();
 }
Ejemplo n.º 3
0
 function init()
 {
     parent::init();
     //	$this->obj = new Model;
 }