Skip to content

Commit

Permalink
renamed Form Twig templates to be more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jun 16, 2011
1 parent 1e992c2 commit a7974ff
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion UPDATE.md
Expand Up @@ -83,7 +83,7 @@ beta4 to beta5

After:

`div_layout.html.twig`
`form_div_layout.html.twig`

* All settings regarding the cache warmers have been removed.

Expand Down
@@ -1,4 +1,4 @@
{% use "div_layout.html.twig" %}
{% use "form_div_layout.html.twig" %}

{% block field_row %}
{% spaceless %}
Expand Down
Expand Up @@ -49,11 +49,11 @@ private function addFormSection(ArrayNodeDefinition $rootNode)
->children()
->arrayNode('resources')
->addDefaultsIfNotSet()
->defaultValue(array('div_layout.html.twig'))
->defaultValue(array('form_div_layout.html.twig'))
->validate()
->always()
->then(function($v){
return array_merge(array('div_layout.html.twig'), $v);
return array_merge(array('form_div_layout.html.twig'), $v);
})
->end()
->prototype('scalar')->end()
Expand Down
Expand Up @@ -31,7 +31,7 @@ public function testLoadEmptyConfiguration()
$this->compileContainer($container);

$this->assertEquals('Twig_Environment', $container->getParameter('twig.class'), '->load() loads the twig.xml file');
$this->assertContains('div_layout.html.twig', $container->getParameter('twig.form.resources'), '->load() includes default template for form resources');
$this->assertContains('form_div_layout.html.twig', $container->getParameter('twig.form.resources'), '->load() includes default template for form resources');

// Twig options
$options = $container->getParameter('twig.options');
Expand All @@ -54,7 +54,7 @@ public function testLoadFullConfiguration($format)

// Form resources
$resources = $container->getParameter('twig.form.resources');
$this->assertContains('div_layout.html.twig', $resources, '->load() includes default template for form resources');
$this->assertContains('form_div_layout.html.twig', $resources, '->load() includes default template for form resources');
$this->assertContains('MyBundle::form.html.twig', $resources, '->load() merges new templates into form resources');

// Globals
Expand Down
Expand Up @@ -37,7 +37,7 @@ protected function setUp()
));

$this->extension = new FormExtension(array(
'div_layout.html.twig',
'form_div_layout.html.twig',
'custom_widgets.html.twig',
));

Expand Down
Expand Up @@ -37,7 +37,7 @@ protected function setUp()
));

$this->extension = new FormExtension(array(
'table_layout.html.twig',
'form_table_layout.html.twig',
'custom_widgets.html.twig',
));

Expand Down
@@ -1,4 +1,4 @@
{% extends 'div_layout.html.twig' %}
{% extends 'form_div_layout.html.twig' %}

{% block field_widget %}
{% spaceless %}
Expand Down
@@ -1,4 +1,4 @@
{% use 'div_layout.html.twig' %}
{% use 'form_div_layout.html.twig' %}

{% block field_widget %}
{% spaceless %}
Expand Down

4 comments on commit a7974ff

@stof
Copy link
Member

@stof stof commented on a7974ff Jun 16, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be documented in UPDATE.md

@stof
Copy link
Member

@stof stof commented on a7974ff Jun 16, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, missed the first change

@vicb
Copy link
Contributor

@vicb vicb commented on a7974ff Jun 16, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabpot should we also rename the blocks ? thinking of possible name clash when theming from _self (i.e. w/ options or attributes)

@fabpot
Copy link
Member Author

@fabpot fabpot commented on a7974ff Jun 17, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vicb: right. fixed here: 627a7f7

Please sign in to comment.