Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store templates under app/Resources/views #5281

Merged
merged 1 commit into from
May 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cookbook/form/create_custom_field_type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ link for details), create a ``gender_widget`` block to handle this:

.. code-block:: html+jinja

{# src/AppBundle/Resources/views/Form/fields.html.twig #}
{# app/Resources/views/Form/fields.html.twig #}
{% block gender_widget %}
{% spaceless %}
{% if expanded %}
Expand All @@ -132,7 +132,7 @@ link for details), create a ``gender_widget`` block to handle this:

.. code-block:: html+php

<!-- src/AppBundle/Resources/views/Form/gender_widget.html.php -->
<!-- app/Resources/views/Form/gender_widget.html.php -->
<?php if ($expanded) : ?>
<ul <?php $view['form']->block($form, 'widget_container_attributes') ?>>
<?php foreach ($form as $child) : ?>
Expand Down
4 changes: 2 additions & 2 deletions cookbook/form/dynamic_form_modification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ field according to the current selection in the ``sport`` field:

.. code-block:: html+jinja

{# src/AppBundle/Resources/views/Meetup/create.html.twig #}
{# app/Resources/views/Meetup/create.html.twig #}
{{ form_start(form) }}
{{ form_row(form.sport) }} {# <select id="meetup_sport" ... #}
{{ form_row(form.position) }} {# <select id="meetup_position" ... #}
Expand Down Expand Up @@ -667,7 +667,7 @@ field according to the current selection in the ``sport`` field:

.. code-block:: html+php

<!-- src/AppBundle/Resources/views/Meetup/create.html.php -->
<!-- app/Resources/views/Meetup/create.html.php -->
<?php echo $view['form']->start($form) ?>
<?php echo $view['form']->row($form['sport']) ?> <!-- <select id="meetup_sport" ... -->
<?php echo $view['form']->row($form['position']) ?> <!-- <select id="meetup_position" ... -->
Expand Down
12 changes: 6 additions & 6 deletions cookbook/form/form_customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ can now re-use the form customization across many templates:

.. code-block:: html+jinja

{# src/AppBundle/Resources/views/Form/fields.html.twig #}
{# app/Resources/views/Form/fields.html.twig #}
{% block integer_widget %}
<div class="integer_widget">
{% set type = type|default('number') %}
Expand Down Expand Up @@ -354,7 +354,7 @@ file in order to customize the ``integer_widget`` fragment.

.. code-block:: html+php

<!-- src/AppBundle/Resources/views/Form/integer_widget.html.php -->
<!-- app/Resources/views/Form/integer_widget.html.php -->
<div class="integer_widget">
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : "number")) ?>
</div>
Expand Down Expand Up @@ -426,7 +426,7 @@ the base block by using the ``parent()`` Twig function:

.. code-block:: html+jinja

{# src/AppBundle/Resources/views/Form/fields.html.twig #}
{# app/Resources/views/Form/fields.html.twig #}
{% extends 'form_div_layout.html.twig' %}

{% block integer_widget %}
Expand Down Expand Up @@ -543,7 +543,7 @@ PHP
~~~

By using the following configuration, any customized form fragments inside the
``src/AppBundle/Resources/views/Form`` folder will be used globally when a
``app/Resources/views/Form`` folder will be used globally when a
form is rendered.

.. configuration-block::
Expand Down Expand Up @@ -670,7 +670,7 @@ customize the ``name`` field only:

<?php echo $view['form']->widget($form['name']); ?>

<!-- src/AppBundle/Resources/views/Form/_product_name_widget.html.php -->
<!-- app/Resources/views/Form/_product_name_widget.html.php -->
<div class="text_widget">
echo $view['form']->block('form_widget_simple') ?>
</div>
Expand Down Expand Up @@ -727,7 +727,7 @@ You can also override the markup for an entire field row using the same method:

<?php echo $view['form']->row($form['name']); ?>

<!-- src/AppBundle/Resources/views/Form/_product_name_row.html.php -->
<!-- app/Resources/views/Form/_product_name_row.html.php -->
<div class="name_row">
<?php echo $view['form']->label($form) ?>
<?php echo $view['form']->errors($form) ?>
Expand Down
12 changes: 6 additions & 6 deletions cookbook/templating/PHP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ the ``extend()`` call:

.. code-block:: html+php

<!-- src/AppBundle/Resources/views/Hello/index.html.php -->
<!-- app/Resources/views/Hello/index.html.php -->
<?php $view->extend('AppBundle::layout.html.php') ?>

Hello <?php echo $name ?>!
Expand All @@ -133,7 +133,7 @@ Now, have a look at the ``layout.html.php`` file:

.. code-block:: html+php

<!-- src/AppBundle/Resources/views/layout.html.php -->
<!-- app/Resources/views/layout.html.php -->
<?php $view->extend('::base.html.php') ?>

<h1>Hello Application</h1>
Expand Down Expand Up @@ -181,7 +181,7 @@ decorating the template. In the ``index.html.php`` template, define a

.. code-block:: html+php

<!-- src/AppBundle/Resources/views/Hello/index.html.php -->
<!-- app/Resources/views/Hello/index.html.php -->
<?php $view->extend('AppBundle::layout.html.php') ?>

<?php $view['slots']->set('title', 'Hello World Application') ?>
Expand Down Expand Up @@ -223,14 +223,14 @@ Create a ``hello.html.php`` template:

.. code-block:: html+php

<!-- src/AppBundle/Resources/views/Hello/hello.html.php -->
<!-- app/Resources/views/Hello/hello.html.php -->
Hello <?php echo $name ?>!

And change the ``index.html.php`` template to include it:

.. code-block:: html+php

<!-- src/AppBundle/Resources/views/Hello/index.html.php -->
<!-- app/Resources/views/Hello/index.html.php -->
<?php $view->extend('AppBundle::layout.html.php') ?>

<?php echo $view->render('AppBundle:Hello:hello.html.php', array('name' => $name)) ?>
Expand All @@ -253,7 +253,7 @@ If you create a ``fancy`` action, and want to include it into the

.. code-block:: html+php

<!-- src/AppBundle/Resources/views/Hello/index.html.php -->
<!-- app/Resources/views/Hello/index.html.php -->
<?php echo $view['actions']->render(
new \Symfony\Component\HttpKernel\Controller\ControllerReference('AppBundle:Hello:fancy', array(
'name' => $name,
Expand Down