Skip to content

Commit

Permalink
[6-12] inputAction()メソッド
Browse files Browse the repository at this point in the history
  • Loading branch information
hidenorigoto committed Dec 28, 2015
1 parent 11d3314 commit a6b4f1e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/lists/ch06/06-12.txt
@@ -0,0 +1,16 @@
/**
* @Route("/{id}/edit")
* @ParamConverter("inquiry", class="AppBundle:Inquiry")
* @Method("get")
*/
public function inputAction(Inquiry $inquiry)
{
$form = $this->createInquiryForm($inquiry);

return $this->render('Admin/Inquiry/edit.html.twig',
[
'form' => $form->createView(),
'inquiry' => $inquiry
]
);
}
17 changes: 17 additions & 0 deletions src/AppBundle/Controller/AdminInquiryEditController.php
Expand Up @@ -14,6 +14,23 @@
*/
class AdminInquiryEditController extends Controller
{
/**
* @Route("/{id}/edit")
* @ParamConverter("inquiry", class="AppBundle:Inquiry")
* @Method("get")
*/
public function inputAction(Inquiry $inquiry)
{
$form = $this->createInquiryForm($inquiry);

return $this->render('Admin/Inquiry/edit.html.twig',
[
'form' => $form->createView(),
'inquiry' => $inquiry
]
);
}

private function createInquiryForm($inquiry)
{
return $this->createFormBuilder($inquiry,
Expand Down

0 comments on commit a6b4f1e

Please sign in to comment.