![]() Keeping the logic inside the action also makes it easier to have several templates for a single action, without any code duplication. ![]() You should keep PHP code to a minimum in templates, since these files are the ones used to design the GUI of the application, and are sometimes created and maintained by another team, specialized in presentation but not in application logic. ![]() Listing 7-1 - A Sample indexSuccess.php TemplateĪs explained in Chapter 4, the alternative PHP syntax is preferable for templates to make them readable for non-PHP developers. It contains some HTML code and some basic PHP code, usually calls to variables defined in the action (via $this->name = 'foo' ) and helpers. Listing 7-1 shows a typical symfony template. When dealing with variables in the templates, the risks of cross-site scripting must not be ignored, and a good comprehension of output escaping techniques is required to safely record user data.īut whatever your role is, you will find useful tools to speed up the tedious job of presenting the results of the action.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |