Web Geek

Collection of web development resources written for beginners!

php and Symfony2

This page holds a number of how-to’s for setting up your application with Symfony2 and includes instruction sets for creating individual bundles. These instruction sets are for use on mac osx and assume some prior knowledge of programming concepts.

Getting Started

Symfony is a free open source framework which allows the user to build applications in php. In this example I’m going to use phpstorm as my text editor, mySQL for my database, ubuntu for the server and an application called prepros for converting css to sass.

Create a Global Bundle

The following example will create a global bundle with symfony2 which will control all bundles in the application. This will house all traits and characteristics applicable to more than one other bundle that I’ll be building later on. Take note of the naming conventions for directories and files.

Create a Page Bundle

Adding on to the Global Bundle created in my previous article, the following will demonstrate how to create a Page Bundle with Symfony2 which is going to take care, specifically of handling page displays and features specific to pages, for the app I’m building.

Set up mySQL

The following example will demonstrate how to manually set up mySQL database with Symfony2 and mySQL2 for a specific bundle in your application.

Essential Traits

The following will describe some essential traits for Symfony2 and how to include them into the page bundle I’ve recently built.

Create page with Symfony2

Create a Page bundle with Symfony 2.

Create Page Listener

Build a Listener for your new page to listen for event changes.

Delete and Edit Pages

Create delete and edit actions for your new page