standalone-forms | example project demonstrates the use of Symfony2 forms | Web Framework library
kandi X-RAY | standalone-forms Summary
kandi X-RAY | standalone-forms Summary
This example project demonstrates the use of Symfony2 forms without Symfony2.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of standalone-forms
standalone-forms Key Features
standalone-forms Examples and Code Snippets
Community Discussions
Trending Discussions on standalone-forms
QUESTION
I have a question regarding symfony/form
using as a standalone component and security-csrf
running with PHP build-in server. I hardly remember having such issue with the Symfony framework.
When setting symfony/form
as a standalone component I tried this code for both v4.2 and v5.1 https://github.com/xmgcoyi/standalone-forms/tree/4.2+twig. A rewrite of webmozart's example mentioned here https://symfony.com/doc/current/components/form.html
The csrf token is generated with twig-bridge, but when submitting the form - on calling$form->isValid()
- invalid csrf
error appears.
By default csrf protection is enabled, setting to false
- the form submits.
Tried CSRF component with both setups with NativeSessionTokenStorage
and SessionTokenStorage + Session of HttpFoundation
.
Could you give any hint on what I'm doing wrong and where to look at?
P.S. Code samples with csrf error on submission:
- https://github.com/xmgcoyi/standalone-forms/tree/4.2+twig
- https://github.com/liorchamla/pratique-symfony-form/tree/06-protection-csrf
UPD The apps above work well, the problem was in browser storage filled with garbage.
Setting to false
in $formFactory->createBuilder(FormType::class, null, ['csrf_protection' => false])
submits the form
ANSWER
Answered 2020-Aug-25 at 17:33This is a bit of a guess but the 4.2 linked repo has:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install standalone-forms
[Download Composer][1].
Install the Composer dependencies. ``` php composer.phar install ```
Add the project to your web server configuration.
Launch web/index.php
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page