コード例 #1
0
 public function init()
 {
     parent::init();
     // TODO: Change the autogenerated stub
     $view = $this->getView();
     SearchAsset::register($view);
 }
コード例 #2
0
 public function init()
 {
     $searchModelData = Yii::$app->getModule(Module::$name)->model('searchModel');
     $searchUrlString = Yii::$app->getModule(Module::$name)->searchUrlString;
     $this->searchModel = Yii::createObject($searchModelData);
     if (!$this->searchModel instanceof AbstractSearch) {
         throw new Exception("Search model must implement 'searchInterface'");
     }
     $this->searchUrl = is_null($searchUrlString) ? NULL : Url::to([$searchUrlString]);
     $view = $this->getView();
     SearchAsset::register($view);
 }