Join Jon Peck for an in-depth discussion in this video Delegating presentation to a view template, part of Learning Symfony2 for PHP (2014).
Integral to every view is a template.…Templates are text files that are used to generate content…in any text-based format like HTML, XML, CSV, and so forth.…Templates are used by programs known as template engines…or template processors that combine one or more templates…with the data from a model and render the result.…Template engines encourage code organization…by separating design from logic and delegate responsibility…such as modeling to developers and design to designers.…
This reduces the overall amount of effort…that is required to do work by minimizing duplication.…There are couple of different kinds template engines for PHP…and you've probably encountered PHP templates…which are a mix of markup and executable PHP code.…However, from a practical point of view,…PHP templates are filled with problems.…With great power comes great responsibility.…It's incredibly easy to do very…bad things in a PHP template.…Not to say the designers don't know what they're doing…but it's tempting an easy to mix…business logic with presentation.…
- Installing Symfony
- Creating a bundle from the console
- Customizing and generating database tables
- Generating controllers
- Creating, editing, and debugging entities
- Displaying and debugging a form
- Rendering content with templates
Skill Level Intermediate
Q: When trying to access the application, I receive an error stating "This script is only accessible from localhost." How can I get around this restriction?
A: The development front controller and configuration scripts are protected by default to only allow access from the localhost. Refer to the video titled “Exploring the Symfony layout” to see how to disable this security.