controllers/BooksController.php
/**
     * Getting url from session for returning after working with model.
     * If url is empty, setting it in storage and returning $defaultValue.
     * @param array $defaultValue
     * @return array|mixed
     */
Getting url from session for returning after working with model.
If url is empty, setting it in storage and returning $defaultValue.
@param array $defaultValue
@return array|mixed
Getting url from session for returning after working with model . If url is empty setting it in storage and returning $defaultValue . @param array $defaultValue @return array|mixed
private function checkAfterSaveBookUrl($defaultValue = ['index'])
    {
        $returnUrl = Yii::$app->session->get('afterSaveBookUrl');
        if (empty($returnUrl)) {
            Yii::$app->session->set('afterSaveBookUrl', Yii::$app->request->referrer);
            $returnUrl = $defaultValue;
        }
        return $returnUrl;
    }
private function checkAfterSaveBookUrl ( $ defaultValue = [ 'index' ] ) { $ returnUrl = Yii :: $ app -> session -> get ( 'afterSaveBookUrl' ) ; if ( empty ( $ returnUrl ) ) { Yii :: $ app -> session -> set ( 'afterSaveBookUrl' , Yii :: $ app -> request -> referrer ) ; $ returnUrl = $ defaultValue ; } return $ returnUrl ; }
Getting url from session for returning after working with model.
Getting url from session for returning after working with model .