from the requests (Request) Link start, according to different requests to call the front Controller (Controller), the controller calls the system core function to the requested URI resource routing (routing) resolution, The different action functions are called according to the result of the parsing, generating responses (response data) and returning.
among them, different links are corresponding to different controllers, how the system is judged?
different links must be configured in the App/config/routing.yml file, such as to add/contact links (accessed through index.php/contact), as follows:
Contact :
Path:/contact
Defaults: {_controller:acmedemobundle:Main: Contact}
This configuration means that when the user requests index.php/contact, the routing system executes the contactaction function of the Maincontroller class According to the configuration
The Maincontroller class is deployed as follows:
//src/acme/demobundle/controller/maincontroller.php
Use symfony\component\httpfoundation\response;
Class Maincontroller
{
Public
function contactaction ()
{
//do something implementation function, return here a "contact us!" with H1 label Output
return new Response ('
}
}
Standard Components
The Symfony framework allows us to freely create our own applications and a large number of built-in tools to assist with a wide variety of tasks (such as persisting databases, rendering views, sending messages, processing submission data, validating user input, and handling security)
The Symfony itself contains more than 20 cores of relatively independent components, each of which implements different functions:
Httpfoundation (HTTP Processing): It contains the request class and the response class, mainly handling HTTP requests and responses; session processing; cookie processing; uploading files, etc.
Routing (Routingprocessing): Parses the URI resource and performs the action based on the results of the analysis
Httpfoundation (HTTP Processing):, which contains the request class and the response class, mainly handles HTTP requests and responses; session processing; cookie processing; uploading files, etc.
Form (form Processing): Symfony provides forms components to help us quickly create forms and work with form submission tasks
Validator (HTTP Processing): Define validation rules to validate user-submitted data
ClassLoader (class Loading): auto-load, so that developers can invoke the specified class without the require way to include the file
Templating (Templates): Renders the captured data into an HTML template, separating the logic from the presentation
Security (Handling Security Issues)
Translation (language Translation): Implement multi-lingual capabilities
How the SYMFONY2 framework Works