Skip to content

Instantly share code, notes, and snippets.

@codecowboy
Created July 12, 2011 20:40
Show Gist options
  • Save codecowboy/1078933 to your computer and use it in GitHub Desktop.
Save codecowboy/1078933 to your computer and use it in GitHub Desktop.
edit template
{# this can be used to get an individual form value {{form.username.get('value') } #}
{#classes like input_large are from the formalize framework - see formalize.css#}
<form class="grid_6 prefix_1" action="{{ path('fos_user_profile_edit') }}" {{ form_enctype(form) }} method="POST" class="fos_user_profile_edit">
{{ form_errors(form) }}
<div class="grid_2 alpha">
{{ form_label(form.first_name, 'First Name: ') }}
</div>
<div class="grid_4 omega">
{{ form_widget(form.first_name, { 'attr': {'class': 'input_large'}}) }}
</div>
<div class="grid_2 alpha">
{{ form_label(form.last_name, 'Last Name: ') }}
</div>
<div class="grid_4 omega">
{{ form_widget(form.last_name, { 'attr': {'class': 'input_large'}}) }}
</div>
<div class="grid_2 alpha">
{{ form_label(form.username, 'Username: ') }}
</div>
<div class="grid_4 omega">
{{ form_widget(form.username, { 'attr': {'class': 'input_medium'}}) }}
</div>
<div class="grid_2 alpha">
{{ form_label(form.email, 'Email: ') }}
</div>
<div class="grid_4 omega">
{{ form_widget(form.email,{ 'attr': {'class': 'input_medium'}}) }}
</div>
<div class="grid_2 alpha">
{{ form_label(form.programmes[0].start_date, 'Start date: ') }}
</div>
<div class="grid_4 omega">
{{ form_widget(form.programmes[0].start_date, { 'attr': {'class': 'input_small'}}) }}
</div>
<div class="grid_2 alpha">
{{ form_label(form.programmes[0].end_date, 'End date: ') }}
</div>
<div class="grid_4 omega">
{{ form_widget(form.programmes[0].end_date, { 'attr': {'class': 'input_small'}}) }}
</div>
<div class="grid_2 alpha">
{{ form_label(form.programmes[0].goal, 'Goal: ') }}
</div>
<div class="grid_4 omega">
{{ form_widget(form.programmes[0].goal, { 'attr': {'class': 'input_medium'}}) }}
</div>
<div class="grid_2 alpha">
{{ form_label(form.programmes[0].weekly_target, 'Sessions per week: ') }}
</div>
<div class="grid_4 omega">
{{ form_widget(form.programmes[0].weekly_target, { 'attr': {'class': 'input_medium'}}) }}
</div>
{# csrf token #}
{{ form_widget(form._token) }}
<div>
<input type="submit" value="{{ 'profile.edit.submit'|trans({}, 'FOSUserBundle') }}" />
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment