AM
yii-web > yii-rest> api-приложения
Size: a a a
AM
DS
СП
СП
yii-web
...yii-csrf
Зависит от yii-web
(для сессий)yii-view
добавить зависимость от yii-csrf
(и от yii-web
по цепочке) для CsrfViewInjection
DS
DS
yii-web
...yii-csrf
Зависит от yii-web
(для сессий)yii-view
добавить зависимость от yii-csrf
(и от yii-web
по цепочке) для CsrfViewInjection
СП
СП
$request->withAttribute($this->requestName, $token);
?NO
DS
$request->withAttribute($this->requestName, $token);
?СП
$request->withAttribute($this->requestName, $token);
?СП
DS
DS
$request->withAttribute($this->requestName, $token);
?DS
СП
DS
СП
DS
public viewAction(CsrfTokenInterface $csrf)
{
$this->view->render('view', ['_csrf' => $csrf->getToken()])
}
СП