Guest User

Untitled

a guest
Oct 15th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1.     NEW TEMPLATE
  2.  
  3. <f:layout name="Default" />
  4. <f:section name="Title">New father</f:section>
  5. <f:section name="Content">
  6.  
  7.     <f:form action="create" objectName="newFathers">
  8.         <label for="name">Father 01</label>
  9.         <f:form.textfield property="0.name" />
  10.         <label for="nameson">Sons</label>
  11.         <f:form.textfield property="0.sons.0.name" id="sonInput00" /><br>
  12.         <f:form.textfield property="0.sons.1.name" id="sonInput01" /><br>
  13.         <f:form.textfield property="0.sons.2.name" id="sonInput02" /><br>
  14.         <br>
  15.         <label for="name">Father 02</label>
  16.         <f:form.textfield property="1.name" />
  17.         <label for="nameson">Sons</label>
  18.         <f:form.textfield property="1.sons.0.name" id="sonInput10" />
  19.         <f:form.textfield property="1.sons.1.name" id="sonInput11" />
  20.         <f:form.textfield property="1.sons.2.name" id="sonInput12" />
  21.         <f:form.submit value="Create" />
  22.     </f:form>
  23.  
  24. </f:section>
  25.  
  26.  
  27. Create Action
  28. /**
  29.      * Adds the given new array of father objects to the father repository
  30.      *
  31.      * @param array<\Mario\Basic\Domain\Model\Father> $newFathers An array of new fathers to add
  32.      * @return void
  33.      */
  34.     public function createAction(array $newFathers) {
  35.         foreach ($newFathers as $father) {
  36.             $this->fatherRepository->add($father);
  37.         }
  38.     }
Advertisement
Add Comment
Please, Sign In to add comment