Skip to content

Commit

Permalink
fix on edit form
Browse files Browse the repository at this point in the history
  • Loading branch information
juliensnz committed Apr 11, 2014
1 parent ad6d88f commit 039df5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ protected function setDefaultOptions(OptionsResolverInterface $optionsResolver)
$optionsResolver->setDefaults(
array(
'base_template' => 'PimCustomEntityBundle::layout.html.twig',
'edit_template' => 'PimCustomEntityBundle:CustomEntity:edit.html.twig',
'edit_template' => 'PimCustomEntityBundle:CustomEntity:form.html.twig',
'index_template' => 'PimCustomEntityBundle:CustomEntity:index.html.twig',
'create_template' => 'PimCustomEntityBundle:CustomEntity:edit.html.twig',
'create_template' => 'PimCustomEntityBundle:CustomEntity:form.html.twig',
'create_form_type' => null,
'create_form_options' => null,
'create_default_properties' => array(),
Expand Down
20 changes: 11 additions & 9 deletions Resources/views/CustomEntity/form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
{% set indexUrl = path(indexRoute, { customEntityName: customEntityName }) %}
{% set buttons %}
{{ elements.backLink(indexUrl) }}
{{
elements.deleteLink(
path(removeRoute, { customEntityName: customEntityName, id: form.vars.value.id }),
null,
indexUrl,
('confirmation.remove.' ~ customEntityName)|trans,
('flash.' ~ customEntityName ~ '.removed')|trans
)
}}
{% if form.vars.value.id is defined and form.vars.value.id != '' %}
{{
elements.deleteLink(
path(removeRoute, { customEntityName: customEntityName, id: form.vars.value.id }),
null,
indexUrl,
('confirmation.remove.' ~ customEntityName)|trans,
('flash.' ~ customEntityName ~ '.removed')|trans
)
}}
{% endif %}
{{ elements.submitBtn() }}
{% endset %}
{{ elements.page_header(title, buttons, null, null, elements.updated(form.vars.id)) }}
Expand Down

0 comments on commit 039df5a

Please sign in to comment.