Skip to content

Instantly share code, notes, and snippets.

@kdambekalns
Created November 28, 2012 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdambekalns/4723a319a6fda25ff890 to your computer and use it in GitHub Desktop.
Save kdambekalns/4723a319a6fda25ff890 to your computer and use it in GitHub Desktop.
Form with dynamic fields
<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>
<?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