Basic structure of a Symfony project

- Andrés Cruz

En español
Basic structure of a Symfony project

The structure of a project in Symfony is made up of a series of folders to which we can attach several of our own to extend functionalities and modularize and customize our development; For example, we can create Services to add small tasks that can be used by different actions in different controllers (something like Helpers in CodeIgniter); even so, Symfony has some folders that are fixed or mandatory which we can see as soon as we create a project as we showed in a previous post:

  1. ¿Cómo instalar y configurar Symfony en Linux en dos pasos?
  2. Cómo instalar symfony en dos sencillos pasos con composer

Among those you should know we have:

Folder app/

This folder contains most of the application's configuration files, such as the database and the templates that we use in the Bundles.

Folder src/

Virtually all of our custom code or the code that we generate will be contained within this folder with its respective organization tree.

Folder bin/

The commands that we use from the CRM or the terminal in Linux are files that are located in bin/console.

Folder test/


Folder  var/

This folder is generated automatically, in it you will find other folders such as the cache which can cause several problems when developing the application as well as the logs and sessions.

Folder vendor/

Here you will find any package that we download via composer, such as the knpbundles Bundle where we will find a large number of Bundles ready to use.

Folder web

This is the root of our project, all the web resources such as images, CSS and JavaScript go here.

Andrés Cruz

Desarrollo con Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz en Udemy

Acepto recibir anuncios de interes sobre este Blog.