modules/api/v1/controllers/SearchHistoryController.php
/**
     * Creates a new SearchHistory model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new SearchHistory model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new SearchHistory model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new SearchHistory();
        $postData = Yii::$app->request->post();
        $searchHistory['SearchHistory'] = $postData;
        $searchHistory['SearchHistory']['user_id'] = Yii::$app->user->identity->id;
        if ($model->load($searchHistory) && $model->validate()) {
            $model->save();
        }
       return $model;
    }
public function actionCreate ( ) { $ model = new SearchHistory ( ) ; $ postData = Yii :: $ app -> request -> post ( ) ; $ searchHistory [ 'SearchHistory' ] = $ postData ; $ searchHistory [ 'SearchHistory' ] [ 'user_id' ] = Yii :: $ app -> user -> identity -> id ; if ( $ model -> load ( $ searchHistory ) && $ model -> validate ( ) ) { $ model -> save ( ) ; } return $ model ; }
Creates a new SearchHistory model.
Creates a new SearchHistory model .