This article mainly introduces the ten-minute tutorial on Symfony, detailed the basic operation skills such as Symfony installation configuration, project initialization, Bundle creation, design entity, constraint addition, addition, deletion, modification, and query, for more information, see Symfony, a powerful PHP-based Web development framework. Here we will spend ten minutes to create a simple program for adding, deleting, modifying, and querying, anyone unfamiliar with Symfony can complete their first Symfony program through this tutorial.
If you need all the source code of this sample program, you can access it or obtain the source code in the following way:
$ Git clone https://github.com/saharabear/symfony-sample.git
Project Initialization
First, you need to install the PHP environment on your computer and install git. this is the basic content, and there are a lot of tutorials on the network. I will not introduce them here, but I should note that PHP starts from 5.4, the test server has been built in, and Symfony embraces this built-in PHP server. You only need to use $ php app/console server in the command line: run can start a PHP program based on the Symfony framework for testing. Therefore, you do not need to use the xampp complex integration environment, install PHP directly and make sure that you can execute the php Command under the command line.
Then, we need to create a new directory named symfony-sample. Symfony uses a program named composer to manage the dependencies of various class libraries. Therefore, if composer is installed on your machine, you can skip this step. If not, you can use the following command to install the latest version of composer.
$ Cd symfony-sample $ curl-sS https://getcomposer.org/installer | php
If you want to know