Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NEW TEMPLATE
- <f:layout name="Default" />
- <f:section name="Title">New father</f:section>
- <f:section name="Content">
- <f:form action="create" objectName="newFathers">
- <label for="name">Father 01</label>
- <f:form.textfield property="0.name" />
- <label for="nameson">Sons</label>
- <f:form.textfield property="0.sons.0.name" id="sonInput00" /><br>
- <f:form.textfield property="0.sons.1.name" id="sonInput01" /><br>
- <f:form.textfield property="0.sons.2.name" id="sonInput02" /><br>
- <br>
- <label for="name">Father 02</label>
- <f:form.textfield property="1.name" />
- <label for="nameson">Sons</label>
- <f:form.textfield property="1.sons.0.name" id="sonInput10" />
- <f:form.textfield property="1.sons.1.name" id="sonInput11" />
- <f:form.textfield property="1.sons.2.name" id="sonInput12" />
- <f:form.submit value="Create" />
- </f:form>
- </f:section>
- Create Action
- /**
- * Adds the given new array of father objects to the father repository
- *
- * @param array<\Mario\Basic\Domain\Model\Father> $newFathers An array of new fathers to add
- * @return void
- */
- public function createAction(array $newFathers) {
- foreach ($newFathers as $father) {
- $this->fatherRepository->add($father);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment