Use Symfony 2 to develop a tracing platform within three hours

Source: Internet
Author: User
Tags functions php language

Brief introduction

Symfony2 is a Web development framework based on PHP language, which has the characteristics of fast development and high performance. But Symfony2 learning curve is also relatively steep, inexperienced beginners often need some practice to master its characteristics.

This paper introduces some core functions and features of SYMFONY2 framework through an example of rapid development of the tracing platform. By reading this article, you can learn about the excellent features and technical features of the SYMFONY2 framework by using the SYMFONY2 framework to support the advantages of rapid web development.

Suitable for the crowd

This article is intended for readers who want to improve the development techniques of the PHP language, or who are interested in the SYMFONY2 framework.

This article also applies to system architects and various technical decision makers.

1. Foreword

On the recent April 20, a 7-magnitude earthquake occurred in Yaan region, Sichuan Province, China, and the cumulative number of victims reached more than 2 million. The missing platform in such circumstances can play a lot of help, and, the sooner the search platform on-line, the higher the practical value.

Symfony2 can be used to support the construction of large web sites, in the small and medium-sized Web site quickly build and develop also has very good support. I would like to take this opportunity to share with you the details of how I developed a Web site for pfif[^1 in 3 hours, based on Symfony2, and I hope that readers will have some understanding of SYMFONY2 components and functions.

[^1]: People Finder interchange Format (wiki) is a widely used open data structure and standard that can be used to exchange tracing information between different organizations or Web sites after a disaster occurs, helping those who have lost contact to find each other.

Use of 2.Bundle

One of the biggest features of the SYMFONY2 framework and associated communities is support for bundle. What is bundle? In simple terms, bundle is an abstraction of "function". By abstracting a class of specific problems into a bundle, you can split the logic of a system: Bundle developers can focus on solving some sort of problem, while bundle users can focus on their business logic.

In the field of Internet development, there are many functions that can be abstracted. such as user login system, such as news commentary, such as Js/css file compression and merging and so on. To give a specific example, such as user login system, most of the project requirements for the user system is virtually the same, but each time to develop new products, more or less will be to recreate a whole or a part of the user system wheel. The emergence of a bundle that is dedicated to managing user systems can reduce the development pressure of these projects and improve the quality of the project while speeding up the overall development of the project.

Symfony2 also supports bundle. The Symfony2 community has a large number of community-maintained bundle, and using these open source bundle allows our project to directly own the functionality provided by that part of the bundle.

The following is a list of some of the third-party bundle used in this project and the tasks that are assigned to them.

Bundle Name Function Introduction responsibilities in the project
Mopabootstrapbundle Provides bootstrap-based page structure and templates Provides a basic HTML schema for a page, style
Nelmioapidocbundle Document and interface test tools for automatically generating APIs Generate API documentation and interface test tools, and allow engineers and third party callers to use tools to test whether the interface is normal
Jmsserializerbundle Object for serialization Tools In an interface, convert a Doctrine2-generated entity object to JSON format

You need to install a bundle, which usually takes only two steps:

Install these bundle using composer

Configure the Symfony2, turn on these bundle support and do some setup work.

Most bundle can be integrated into your project through the two steps above, and installing these bundle only need to modify some configuration files and run a system command.

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.