Update book to comply with best practices, round 3#4779
Update book to comply with best practices, round 3#4779weaverryan merged 5 commits intosymfony:2.3from
Conversation
wouterj
commented
Jan 6, 2015
| Q | A |
|---|---|
| Doc fix? | yes |
| New docs? | yes |
| Applies to | all |
| Fixed tickets | #4431 |
best_practices/templates.rst
Outdated
There was a problem hiding this comment.
I believe this was the guideline, but it was never written somewhere. As lots of people are struggling with it, I think it's a good idea to document it. While doing this, I've also snake_cased all template paths in the currently updated book articles.
There was a problem hiding this comment.
@javiereguiluz What do you think? We've never talked too much about this directly. The negative to underscoring everything is that templates aren't the same as their controllers anymore - PostAdminController::createPostAction would be in post_admin/create_post.html.twig.
We're just talking about a recommendation here - not life or death - but let's think about it. The old upper-camel case was done without really thinking, to support the @Template magic (because we were all very used to having this from 1.x). If we break from this, then @Template won't work, and even if we update it, trying to transform from createPostAction to create_post.html.twig could be buggy.
What do guys think?
There was a problem hiding this comment.
In this moment, my thinking is that the old way seems the best, as it's very simple: everything just matches: no transformations (of course, you can do whatever you want).
There was a problem hiding this comment.
ping @javiereguiluz I need your input on upper/lower case template directories here - this will affect a lot of different parts. Thanks :)
|
While changing the Testing and HttpCache articles, I got a bit distracted fixing other things :) I'll do a follow up PR of a Testing article rewrite, as it isn't really nicely written (and it's the oldest not actively maintained document). |
|
This will conflict with #4740 |
|
I don't think so, as Javier updated the cookbook and I the book |
|
ah, I forgot the fact that his PR does not do the search and replace on the whole doc. 👍 |
book/validation.rst
Outdated
There was a problem hiding this comment.
This is not correct, see #4789 (including some other fixes)
There was a problem hiding this comment.
What's the issue? Just that we should have the line breaks different?
book/http_cache.rst
Outdated
There was a problem hiding this comment.
This should be something like default/homepage.html.twig
1fb5a7e to
6d10392
Compare
6d10392 to
ce95b52
Compare
There was a problem hiding this comment.
i would prefer valid php here.
ce95b52 to
3ab53a6
Compare