Creating a blog in Symfony2¶
This tutorial will guide you through the process of creating a full featured blogging website using Symfony2. The Standard Distribution of the Symfony2 framework will be used, which includes the main components you will need when building your own websites. The tutorial is split into a number of parts, each part covering different aspects of Symfony2 and its components. This tutorial is aimed to be worked through similar to the symfony 1 Jobeet tutorial.
- [Part 1] - Symfony2 Configuration and Templating
- [Part 2] - Contact Page: Validators, Forms and Emailing
- [Part 3] - The Blog Model: Using Doctrine 2 and Data Fixtures
- [Part 4] - The Comments Model: Adding comments, Doctrine Repositories and Migrations
- [Part 5] - Customising the view: Twig extensions, The sidebar and Assetic
- [Part 6] - Testing: Unit and Functional with PHPUnit
This tutorial aims to cover the common tasks you are faced with when creating websites using Symfony2.
- Templating (Using TWIG)
- Model - Doctrine 2
- Data Fixtures
- Asset Management
- Customising Error pages
- The User & Sessions
- CRUD Generation
Symfony2 is highly customisable and provides a number of different ways to perform the same task. Some examples of this include writing configuration options in YAML, XML, PHP, or Annotation, and creating templates using Twig or PHP. To keep this tutorial simple we will use YAML and Annotations for configuration and Twig for templating. The Symfony book provides a great resource for examples of how to use the other methods. If other people would like to contribute to the completion of alternative methods simply fork the repository on Github and send over the pull requests :)
The source for this tutorial is available on Github. If you would like to improve and extend this tutorial simply fork the project and send over the pull requests. You can also raise issues using the GitHub Issue Tracker. If any one is interested in creating a much more visually pleasing design please get in touch!
Special thanks to all the contributors of the Official Symfony2 documentation. This provided an invaluable resource of information.
Flag Icons sourced from famfamfam.