Generated templates extend ::base.html.twig
merged branch jalliot/template_gen (PR #37)

This PR was merged into the master branch.

Commits
-------

1ee70ab Generated templates extend ::base.html.twig

Discussion
----------

[2.2] Generated templates now extend ::base.html.twig

Generated templates for CRUD should extend '::base.html.twig' as a best practise.
Besides, it allows to have the web debug toolbar on the generated pages too.

---------------------------------------------------------------------------

by stloyd at 2011-07-02T12:07:06Z

IMO you should also add ability to create `base.html.twig` file in `/app/Resources/views/`.

---------------------------------------------------------------------------

by jalliot at 2011-07-02T12:15:01Z

@stloyd Why? The file already exists in the standard distribution.
My proposal is merely a change that permits to have a "better" experience out of the box, **with** the standard distribution.
Of course, if you don't have the standard base.html.twig you will have to change the generated template but you surely will have to do so anyway so I don't think this is a real problem.

---------------------------------------------------------------------------

by stloyd at 2011-07-02T12:19:42Z

@jalliot I didn't say that is an problem, I mean that if you "push" user to have `extend` at base tpl, you should allow him to generate it (even an empty one) if he don't have it yet.

---------------------------------------------------------------------------

by jalliot at 2011-08-23T15:13:12Z

Updated with latest master

---------------------------------------------------------------------------

by jalliot at 2011-08-23T15:23:36Z

As a side note, the generated templates are not HTML-compliant if we don't extend a base layout.
@fabpot What do you think?

---------------------------------------------------------------------------

by ArlingtonHouse at 2011-11-10T13:54:12Z

This is a small but good step forward.  The mark-up currently generated is really incomplete.

---------------------------------------------------------------------------

by Dentxinho at 2011-11-23T13:43:14Z

This PR is obsolete? No one is analysing to merge?

---------------------------------------------------------------------------

by ricardclau at 2012-03-19T16:46:44Z

+1 to this pull request

If there is no &lt;body&gt; &lt;html&gt; markup profiler does not appear and leads to confussion, specially when starting to learn how Symfony works using these tools to automatically generate code.

---------------------------------------------------------------------------

by rapid2k1 at 2012-08-06T12:09:44Z

+1 to this pull request.

No one uses SensioGeneratorBundle? '::base.html.twig' should be extended in all the automatically generated code for consistency!

---------------------------------------------------------------------------

by murilolobato at 2012-08-09T15:36:14Z

+1 to this request.

This made me crazy when i started.

---------------------------------------------------------------------------

by cram1010 at 2012-08-12T10:59:29Z

+1 It's a pitty there is no feedback... :(

---------------------------------------------------------------------------

by fabpot at 2012-08-14T08:29:59Z

This is going to be considered for inclusion in 2.2. @jalliot Can you update this PR as it needs to be rebased? If not, I will do the needed changes directly. Thanks.

---------------------------------------------------------------------------

by ricardclau at 2013-01-19T18:44:28Z

@jalliot ping? can you rebase it? I think this will be another great addition to 2.2

---------------------------------------------------------------------------

by jalliot at 2013-01-20T11:02:58Z

Rebased on master. I couldn't run the test suite though... And I won't have much more time for this PR at the moment.

---------------------------------------------------------------------------

by ricardclau at 2013-01-20T15:18:11Z

@fabpot Is this PR going to be added in 2.2 release?

Most people, when start to play with Symfony2 use this bundle to generate CRUDs and see what's going on. And if HTML markup is incomplete, profiler does not appear... which sometimes makes people a bit crazy as they don't understand what they are doing wrong.