legionofmyown / angsym-forms
Symfony2 forms 与 Angular.js 的演示和处理
1.0.0
2015-10-05 13:07 UTC
Requires
- php: >=5.5.0
This package is not auto-updated.
Last update: 2024-10-02 18:12:25 UTC
README
Symfony2 扩展包,用于向 Angular.js 接口公开表单并处理 AJAX 提交。
使用方法
控制器
/** * @Route("/") * @Template() */ public function indexAction() { return [ 'formName' => Form1::class ]; } /** * @Route("/test-form-1", name="test_form1") * @Template() */ public function testForm1Action(Request $request) { $response = $this->get('angsym.form')->processForm($request, Form1::class, TestEntity::class); return $response; }
Twig
{{ angsym_form('myAppTest', formName, path("test_form1"), 'POST' ) }}