tbreuss / yii2-inertia Goto Github PK
View Code? Open in Web Editor NEWThe Yii 2 server-side adapter for Inertia.js.
License: MIT License
The Yii 2 server-side adapter for Inertia.js.
License: MIT License
Hi. When is the release planned?
Hi there,
The issue occurs when performing redirects. After saving a resource and then redirecting, it only displays a blank modal. I don't know why.
This code works if I don't use route.post(url, model);
` public function actionCreate()
{
$model = new ThirdParty();
if ($this->request->isPost) {
if ($model->load($this->request->post()) && $model->save()) {
return $this->redirect(['index']);
}
}
//dd("redirect");
return $this->inertia('ThirdParty/Create');
}
`
Any idea why?
thanks.
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.
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.
In a controller action if I return a regular respone, regular view with a form, when I submit this form I get a Bad Request (#400) error. I guess this is related to CSRF??
What I'm trying to do is that I don't want to use Inertia in all controllers/actions but use it only in some cases. So I would like to use regular views and forms as usually and be able to "enhance" som controllers using Svelte with Inertia. Is this possible or am I missing something?
Hello there,
just trying and learning inertia.js & vue, I test this demo and, well, the other options work but the initial page throws:
500 error 404 error
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.