public function init() { parent::init(); // custom initialization code goes here \yii::configure($this, require __DIR__ . '/config.php'); $this->params['maxPostCount'] = 50; }
/** * 模块初始化 */ public function init() { parent::init(); // custom initialization code goes here $config = ['components' => [], 'params' => ['name' => '肖红阳'], 'defaultRoute' => 'index', 'aliases' => ['@webName' => '网站管理后台', '@moduleViewPath' => '@app/modules/adminshop/views']]; \yii::configure($this, $config); $this->ec_init(); }
/** * @return object * @throws \yii\base\InvalidConfigException */ public function createQuery() { $model = $this->getModelClass(); /** @var ActiveQuery $query */ $query = $model::find(); if (is_array($query)) { yii::configure($query, $this->query); } if ($this->typification) { $query->andWhere([$this->tableName() . '.' . $this->typeField => $this->type]); } if ($this->softDelete) { $query->andWhere([$this->tableName() . '.' . $this->deleteField => null]); } return $query; }