controllers/RuleController.php
public function actionSearch($q = null)
    {
        \Yii::$app->response->format = Response::FORMAT_JSON;

        return ['results' => $this->getSearchModel()->getRuleNames($q)];
    }
public function actionSearch($q = null)
    {
        \Yii::$app->response->format = Response::FORMAT_JSON;

        return ['results' => $this->getSearchModel()->getRuleNames($q)];
    }
public function actionSearch ( $ q = null ) { \ Yii :: $ app -> response -> format = Response :: FORMAT_JSON ; return [ 'results' => $ this -> getSearchModel ( ) -> getRuleNames ( $ q ) ] ; }
Searches for rules.

@param  string|null $q
@return array
Searches for rules .