芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/airport-back/vendor/yiisoft/yii2-gii/src/generators/crud/default/search.php
modelClass); $searchModelClass = StringHelper::basename($generator->searchModelClass); if ($modelClass === $searchModelClass) { $modelAlias = $modelClass . 'Model'; } $rules = $generator->generateSearchRules(); $labels = $generator->generateSearchLabels(); $searchAttributes = $generator->getSearchAttributes(); $searchConditions = $generator->generateSearchConditions(); echo " namespace = StringHelper::dirname(ltrim($generator->searchModelClass, '\\')) ?>; use yii\base\Model; use yii\data\ActiveDataProvider; use = ltrim($generator->modelClass, '\\') . (isset($modelAlias) ? " as $modelAlias" : "") ?>; /** * = $searchModelClass ?> represents the model behind the search form of `= $generator->modelClass ?>`. */ class = $searchModelClass ?> extends = isset($modelAlias) ? $modelAlias : $modelClass ?> { /** * {@inheritdoc} */ public function rules() { return [ = implode(",\n ", $rules) ?>, ]; } /** * {@inheritdoc} */ public function scenarios() { // bypass scenarios() implementation in the parent class return Model::scenarios(); } /** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = = isset($modelAlias) ? $modelAlias : $modelClass ?>::find(); // add conditions that should always apply here $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } // grid filtering conditions = implode("\n ", $searchConditions) ?> return $dataProvider; } }