Code Monkey home page Code Monkey logo

yii2-inertia's Issues

Redirects issues

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.

Captura desde 2023-10-31 21-35-50

Enhancement: parent::beforeAction in docs

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.

Bad Request (#400) submiting a form on regular response

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?

Dashboard shows 500 error & 404 error

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.