-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSRF Token, viewing Symfony forms in ExtJS #5
Comments
We don't use Symfony forms for viewing only for saving data. So CSRF token is not implemented right now |
But how do you submit a form without token for saving ? do you have disable it in app/config ? |
Yes, protection is disabled, i will make notice in documentation about that. Maybe we find real solution for that |
Ok i have add this method to your Form object :
And tada ! :) i can do in my controller action (without @Form annotation) : $editForm = $this->createForm(new EntityType(), $entity); form is loaded (for edit or create) with _token field. Don't know if it's right method but it work and like you i don't manage subform yet. I think it will be better to test if $form var passed to contructor is an instance of SF Form and if not put an exception. Hope this help … |
Please fork bundle and add this to form response, then make a pull request and patch will be in our code. Great idea. |
Don't know if i will find time to fork i've make many modifications to use it with Extjs4 MVC architecture i will try. This is my last change because my last function dont work on form errors :
i change string returned on validation from msg to errors to get errors automaticly shown on field of the form without more code. I'll will take a look to your last change too I saw the javascript_vendor_path but i dont understand why you dont want to upgrade to full last Extjs4 version ? No need to have duplicate extjs code … Other thing the javascript add in header.html.twig seems to be a bad idea for me because you make this bundle dependant to your futur admin bundle for exemple i already manage this in MVC way with an app.js add in my index view with something like:
for exemple you can have an extjs app by bundle loaded dynamically with its controller in a main app. i can mail you my code if your are interrested but it's in an early stage and i've dont test it with many bundle. |
Send me code. Don't worry about headers, admin related javascripts will be in other place. If header has already something which could be optional, just tell me. |
Hi,
how do you handle form load i understand that the action to handle forms is for form submit. But for the load ?
My problem is mostly to handle the CSRF token.
Otherwise my "patch" seems to be ok.
The text was updated successfully, but these errors were encountered: