php - yii2 disable page cache on post request -
i have page submit form want cache requests. cannot figure out if there way yii2 guide seems hint @ http://www.yiiframework.com/doc-2.0/yii-filters-pagecache.html#$enabled-detail, says can enable requests. know how filter won't cache page when form submitted. right when submits page goes redirect loop.
'pagecache' => [ 'class' => 'yii\filters\pagecache', 'only' => ['nba'], 'dependency' => [ 'class' => 'yii\caching\dbdependency', 'sql' => 'select timestamp e_nbapicks user_id = '.yii::$app->user->id, ], ],
since enabled boolean pass isget
variable \yii\web\request
:
'pagecache' => [ ... 'enabled' => yii::$app->request->isget ]
the request class represents http request. read more on api page
Comments
Post a Comment