-
-
Save kdambekalns/4723a319a6fda25ff890 to your computer and use it in GitHub Desktop.
Form with dynamic fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<f:layout name="Manage" /> | |
<f:section name="Title">Edit organisation "{organisation.name}"</f:section> | |
<f:section name="Content"> | |
<div class="row"> | |
<div class="offset3 span6 well"> | |
<f:form action="update" object="{organisation}" name="organisation" class="form-horizontal"> | |
<f:form.configuration property="aliases.*" allowProperties="name"/> | |
<fieldset> | |
<!-- more stuff here --> | |
<div class="control-group"> | |
<label class="control-label">Alias</label> | |
<div class="controls inline-stacked"> | |
<script type="text/x-formtemplate"> | |
<f:form.textfield property="aliases.0.name" value="" /> | |
<a class="close">x</a> | |
</script> | |
<f:for each="{organisation.aliases}" as="alias" iteration="aliasIterator"> | |
<div class="inline-stacked-item"> | |
<f:form.textfield property="aliases.{aliasIterator.index}.name" /> | |
<a class="close">x</a> | |
</div> | |
</f:for> | |
<div class="inline-stacked-item"> | |
<f:form.textfield property="aliases.{organisation.aliases -> f:count()}.name" value="" /> | |
<a class="close">x</a> | |
</div> | |
</div> | |
</div> | |
<!-- more stuff here --> | |
</fieldset> | |
</f:form> | |
</div> | |
</div> | |
</f:section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// more code here | |
/** | |
* @Flow\Scope("singleton") | |
*/ | |
class OrganisationController extends ActionController { | |
// more code here | |
/** | |
* Shows a form for editing an existing organisation object | |
* | |
* @param \BKWI\Kernkaart\Domain\Model\Organisation $organisation The organisation to edit | |
* @return void | |
*/ | |
public function editAction(Organisation $organisation) { | |
$this->view->assign('organisation', $organisation); | |
} | |
// more code here | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment