{"action":"created","issue":{"url":"https://api.github.com/repos/concrete5/concrete5/issues/2717","labels_url":"https://api.github.com/repos/concrete5/concrete5/issues/2717/labels{/name}","comments_url":"https://api.github.com/repos/concrete5/concrete5/issues/2717/comments","events_url":"https://api.github.com/repos/concrete5/concrete5/issues/2717/events","html_url":"https://github.com/concrete5/concrete5/issues/2717","id":93756641,"number":2717,"title":"Symfony forms integration","user":{"login":"ahukkanen","id":864340,"avatar_url":"https://avatars.githubusercontent.com/u/864340?v=3","gravatar_id":"","url":"https://api.github.com/users/ahukkanen","html_url":"https://github.com/ahukkanen","followers_url":"https://api.github.com/users/ahukkanen/followers","following_url":"https://api.github.com/users/ahukkanen/following{/other_user}","gists_url":"https://api.github.com/users/ahukkanen/gists{/gist_id}","starred_url":"https://api.github.com/users/ahukkanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahukkanen/subscriptions","organizations_url":"https://api.github.com/users/ahukkanen/orgs","repos_url":"https://api.github.com/users/ahukkanen/repos","events_url":"https://api.github.com/users/ahukkanen/events{/privacy}","received_events_url":"https://api.github.com/users/ahukkanen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/concrete5/concrete5/labels/status:under%20discussion","name":"status:under discussion","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-08T10:27:02Z","updated_at":"2015-10-23T18:06:59Z","closed_at":null,"body":"I'd like to hear some thoughts on whether we could introduce [Symfony forms](https://symfony.com/doc/current/book/forms.html) into concrete5.\r\n\r\nThis would really make it easier to build forms on single pages and why not everywhere else as well. It would also generalize e.g. form validation, display of form errors specifically to some field, make the developers write code with less bugs (as we could use generalized components), handle automatically CSRF validation, and probably many other benefits as well. And of course, make the code more testable.\r\n\r\nAnd now that we have the possibility to use Doctrine entities, they can be easily mapped into Symfony forms, so building CRUD interfaces for Doctrine entities would become quite much easier than it is today, almost automatic.\r\n\r\nBasically all the bigger and widely used frameworks provide something similar to this, so this is really an important feature for most developers choosing a good framework to build something bigger.\r\n\r\nAs a reference implementation, here's an example I put together:\r\nhttps://github.com/mainio/c5_symfony_forms_example\r\n\r\nIt relies on a couple of composer packages that I also put together to make this all work within c5.\r\n\r\nIt also uses twig templates not necessarily because I'd want to use them but I realized the twig bridge for the form component is quite much lighter in terms of included packages than the alternative PHP version. If we wanted to use the PHP version, we would need to include quite many composer packages we don't really need or only need a very small portion of it. That's the reason for using the twig bridge there. Or other option is also writing our own bridge for the form component.\r\n\r\nOn the other hand, introducing twig as well into c5 might not be that bad idea either. It seems to have catched up quite well and it's already used by Drupal and it's the default template engine in Symfony, so it's not going anywhere any time soon. And the default engine in Symfony means that all the Symfony documentation provides twig examples as the primary examples of anything related to the views. Other advantages would include enforcing people to keep business logic out of the view layer and also cleaner views in general.\r\n\r\nAny thoughts? Are you open to the idea? How about the twig issue then?"},"comment":{"url":"https://api.github.com/repos/concrete5/concrete5/issues/comments/150650257","html_url":"https://github.com/concrete5/concrete5/issues/2717#issuecomment-150650257","issue_url":"https://api.github.com/repos/concrete5/concrete5/issues/2717","id":150650257,"user":{"login":"zanedev","id":817344,"avatar_url":"https://avatars.githubusercontent.com/u/817344?v=3","gravatar_id":"","url":"https://api.github.com/users/zanedev","html_url":"https://github.com/zanedev","followers_url":"https://api.github.com/users/zanedev/followers","following_url":"https://api.github.com/users/zanedev/following{/other_user}","gists_url":"https://api.github.com/users/zanedev/gists{/gist_id}","starred_url":"https://api.github.com/users/zanedev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanedev/subscriptions","organizations_url":"https://api.github.com/users/zanedev/orgs","repos_url":"https://api.github.com/users/zanedev/repos","events_url":"https://api.github.com/users/zanedev/events{/privacy}","received_events_url":"https://api.github.com/users/zanedev/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T18:06:59Z","updated_at":"2015-10-23T18:06:59Z","body":"+1 building and generating forms and crud interfaces is a sorely lacking manual feature if you come from a rails or cake php world.  addons like block designer help in some ways but then you have another way of doing things not built into the core.  I find myself spending a lot of time building basic crud form interfaces in the dashboard manually would be cool to be able to generate these faster."}}