Closed SOHELAHMED7 closed 4 years ago
In docs (readme.md file), -> "Shared data" section
public function beforeAction() { $shared = [ 'user' => $this->getUser(), 'flash' => $this->getFlashMessages(), 'errors' => $this->getFormErrors() ]; Yii::$app->get('inertia')->share($shared); return true; }
parent::beforeAction($action) statement is not present. It is nice to have there.
parent::beforeAction($action)
So last line of that method should be
return parent::beforeAction($action);
public function beforeAction() { $shared = [ 'user' => $this->getUser(), 'flash' => $this->getFlashMessages(), 'errors' => $this->getFormErrors() ]; Yii::$app->get('inertia')->share($shared); return parent::beforeAction($action); }
If you are fine with above proposal, I can also help with Pull Request.
Good catch! Thank you.
It would be nice to get a pull request.
Do you find some time to do so?
Fixed with bf327d3783b6fd71e4ecb5a057f414ba40b88526. Thanks for reporting.
In docs (readme.md file), -> "Shared data" section
parent::beforeAction($action)
statement is not present. It is nice to have there.So last line of that method should be
return parent::beforeAction($action);
If you are fine with above proposal, I can also help with Pull Request.