Browsing Category

Symfony

0

what are Fixtures symfony ?

After creating the database structure, it would be handy to prepare some test data. We can do this through fixtures. Unfortunately, Symfony2 does not come with any fixtures system, so we need to install it. Type the following: $ php…

Dealing with Forms in symfony

Forms handling, processing, and validation are some of the most common things that we do when we create a web application, and practically, the only way we can request data from a website visitor or user. Handling forms…

Creating a list of tasks in symfony

After we are set, we should create a table with a list of our unfinished tasks. In the previous chapter, when we created a database model we didn't add a column to flag the finished task, so we will do this now to demonstrate how the…

Entities – the Model layer symfony

Entities – the Model layer Finally, we need to dive into the Model layer of Symfony2 framework. Symfony2 heavily relies on Doctrine2. Doctrine2 is one of the most popular object-relational mapping libraries. While there are…

Templates – the View layer symfony 2

Each MVC framework offers the View layer, and Symfony2 is no different. In Symfony1, we were using plain PHP code. Symfony has introduced a new templating engine named Twig. The Symfony syntax is more elegant — it's shorter and…

Routing in symfony 2

Like with many other frameworks based on the concept of MVC, before any controller is actually executed, Symfony2 needs to know how to handle it. The Symfony routing configuration starts within the app/config/routing_*.yml file. Depending…

Cleanups in symfony 2

Before we start writing our own app, we need to do some cleanups. We need to configure AppBundle to use the YAML configuration. While this is possible to switch the configuration format manually, we will remove the bundle (it doesn't…

The configuration format of symfony

Symfony2 can handle configuration in different formats: YAML, XML, and annotations. The main configuration files within app/config are provided with the YAML format. XML is usually harder to read, and is used only with third-party bundles.…

Everything is a bundle in symfony

In the previous articles, we dug in to the basic Symfony2 directory structure. Within the src directory, we already had two bundles: one called DemoBundle within the Acme subdirectory and the other one within AppBundle. DemoBundle is a…

Dive in to Symfony2 console

let's take a look at the Symfony console script. We used it before to fire up the development server, but it offers more. Execute the following: $ php app/console You will see a list of supported commands. Each command has a short…

configuration files in symfony

Each application has a need to hold some global and machine-specific parameters and configurations. Symfony2 holds configuration within the app/config directory and it is split into a few files as follows: config.yml config_dev.yml…

Directory structure of Symfony2

Let's dive in to the initial directory structure within the typical Symfony application. Here it is: app bin src vendor web While Symfony2 is very flexible in terms of directory structure, it is recommended to keep the…

Installating and configuring symfony

Prior to installing Symfony2, you don't need to have a configured web server. If you have at least PHP version 5.4, you can use the standalone server provided by Symfony2. This server is suitable for development purposes and should not be…

The history of Symfony

There are many S ymfony versions around, and it's good to know the differences between them to learn how the framework was evolving during these years. The first stable Symfony version — 1.0 — was released in the beginning of 2007 and was…

Introduction to symfony

The Symfony framework is currently one of the most popular PHP frameworks existing within the PHP developer's environment. Version 2, which was released a few years ago, has been a great improvement, and in my opinion was one of…

Pin It on Pinterest