Symfony core class overview

Source: Internet
Author: User
This article describes the core classes of Symfony. Share it with you for your reference. The details are as follows: The Symfony core class Symfony MVC method uses some of the classes you will often encounter later. sfController is a controller that decodes requests and delivers them to actions. sfRequest stores all request elements (parameters, Cookies, header information, and so on)

This article describes the core classes of Symfony. Share it with you for your reference. The details are as follows: The Symfony core class Symfony MVC method uses some of the classes you will often encounter later. sfController is a controller that decodes requests and delivers them to actions. sfRequest stores all request elements (parameters, Cookies, header information, and so on)

This article describes the core classes of Symfony. We will share this with you for your reference. The details are as follows:

Core classes of Symfony

The Symfony MVC method uses some classes that you will frequently encounter in the future.

1. sfController is a controller that decodes requests and delivers them to actions)

2. sfRequest stores all request elements (parameters, Cookies, header information, etc)

3. sfResponse contains the response header information and content, which are ultimately converted to HTML and sent to the user.

4. A context (obtained through sfContext: getInstance () stores the reference and existing configuration information of all core objects, which can be accessed anywhere.

As you can see, all symfony classes use the sf prefix, which avoids conflicts with your own classes or variables and makes the classes of the core framework easy to recognize.

Code Organization

You already know the different components of the symfony application, but you may not know how it is organized yet.

Project Structure: applications, modules, and actions

In symfony, a project is a group of services and operations under a domain name. They share the object model.

A project consists of multiple applications. An application consists of multiple modules. A module can contain multiple actions.

Project Structure:

Root tree structure and description of Symfony

Apps/

Contains the project application. An application corresponds to a folder.

Batch/

Contains PHP code for command line execution or scheduling.

Cache/

Cache folder, requires 777 permission

Config/

Save basic project configurations

Data/

Stores project data files, such as database structures, SQL files for creating data tables, or SQLite database files.

Doc/

Store project documents, including your own documents and documents generated by PHPDoc

Lib/

Data Model

Log/

Log folder, requires 777 Permissions

Plugins/

Plug-ins installed in applications

Test/

Half-Worker Unit and common test

Web/

WEB Service Root

I hope this article will help you design PHP programs based on the Symfony framework.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.