Answer the question
In order to leave comments, you need to log in
What is the path of the yii controller?
Tell me where to insert the last-modified header?
public function behaviors() {
return [
'HttpCache' => [
'class' => 'yii\filters\HttpCache',
'lastModified' => function ($action, $params) {
$model = \app\models\Products::findOne($_GET['id']);
$time = (empty($model->time_edit))?$model->time_add:$model->time_edit;
return $time;
},
],
];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question