10000 minor #8138 follow best practices for template files (xabbuh) · symfony/symfony-docs@31a0a09 · GitHub
[go: up one dir, main page]

Skip to content

Commit 31a0a09

Browse files
committed
minor #8138 follow best practices for template files (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- follow best practices for template files Commits ------- f0b71f8 follow best practices for template files
2 parents 517f386 + f0b71f8 commit 31a0a09

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

controller/service.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Symfony's base controller::
177177
public function indexAction($name)
178178
{
179179
return $this->render(
180-
'@App/Hello/index.html.twig',
180+
'hello/index.html.twig',
181181
array('name' => $name)
182182
);
183183
}
@@ -213,7 +213,7 @@ service and use it directly::
213213
public function indexAction($name)
214214
{
215215
return $this->templating->renderResponse(
216-
'@App/Hello/index.html.twig',
216+
'hello/index.html.twig',
217217
array('name' => $name)
218218
);
219219
}

form/direct_submit.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ submissions::
2828
return $this->redirectToRoute('task_success');
2929
}
3030

31-
return $this->render('@App/Default/new.html.twig', array(
31+
return $this->render('default/new.html.twig', array(
3232
'form' => $form->createView(),
3333
));
3434
}
@@ -67,7 +67,7 @@ method, pass the submitted data directly to
6767
}
6868
}
6969

70-
return $this->render('@App/Default/new.html.twig', array(
70+
return $this->render('default/new.html.twig', array(
7171
'form' => $form->createView(),
7272
));
7373
}
@@ -126,7 +126,7 @@ a convenient shortcut to the previous example::
126126
}
127127
}
128128

129-
return $this->render('@App/Default/new.html.twig', array(
129+
return $this->render('default/new.html.twig', array(
130130
'form' => $form->createView(),
131131
));
132132
}

form/dynamic_form_modification.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ your application. Assume that you have a sport meetup creation controller::
616616
}
617617

618618
return $this->render(
619-
'@App/Meetup/create.html.twig',
619+
'meetup/create.html.twig',
620620
array('form' => $form->createView())
621621
);
622622
}
@@ -631,7 +631,7 @@ field according to the current selection in the ``sport`` field:
631631

632632
.. code-block:: html+twig
633633

634-
{# app/Resources/views/Meetup/create.html.twig #}
634+
{# app/Resources/views/meetup/create.html.twig #}
635635
{{ form_start(form) }}
636636
{{ form_row(form.sport) }} {# <select id="meetup_sport" ... #}
637637
{{ form_row(form.position) }} {# <select id="meetup_position" ... #}

form/form_collections.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ In your controller, you'll now initialize a new instance of ``TaskType``::
184184
// ... maybe do some form processing, like saving the Task and Tag objects
185185
}
186186

187-
return $this->render('@App/Task/new.html.twig', array(
187+
return $this->render('task/new.html.twig', array(
188188
'form' => $form->createView(),
189189
));
190190
}
@@ -200,7 +200,7 @@ zero tags when first created).
200200

201201
.. code-block:: html+twig
202202

203-
{# src/AppBundle/Resources/views/Task/new.html.twig #}
203+
{# app/Resources/views/task/new.html.twig #}
204204

205205
{# ... #}
206206

profiler/data_collector.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ block and set the value of two variables called ``icon`` and ``text``:
197197

198198
.. code-block:: twig
199199
200-
{{ include('@App/data_collector/icon.svg') }}
200+
{{ include('data_collector/icon.svg') }}
201201
202202
You are encouraged to use the latter technique for your own toolbar panels.
203203

reference/configuration/twig.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ TwigBundle Configuration ("twig")
2222
- bootstrap_3_horizontal_layout.html.twig
2323
2424
# Example:
25-
- @App/form.html.twig
25+
- form.html.twig
2626
2727
globals:
2828
@@ -75,7 +75,7 @@ TwigBundle Configuration ("twig")
7575
optimizations="true"
7676
>
7777
<twig:form-theme>form_div_layout.html.twig</twig:form-theme> <!-- Default -->
78-
<twig:form-theme>@App/form.html.twig</twig:form-theme>
78+
<twig:form-theme>form.html.twig</twig:form-theme>
7979
8080
<twig:global key="foo" id="bar" type="service" />
8181
<twig:global key="pi">3.14</twig:global>
@@ -91,7 +91,7 @@ TwigBundle Configuration ("twig")
9191
$container->loadFromExtension('twig', array(
9292
'form_themes' => array(
9393
'form_div_layout.html.twig', // Default
94-
'@App/form.html.twig',
94+
'form.html.twig',
9595
),
9696
'globals' => array(
9797
'foo' => '@bar',

0 commit comments

Comments
 (0)
0