When using PHP, you can use var_dump() if you need to quickly find the value of a variable passed. This is useful, for example, inside your controller. The same can be achieved when using Twig thanks to the debug extension. Template parameters can then be dumped using the dump function: {{ dump(articles) }}{{ dump(articles) }}
Continue reading Symfony – Twig: debugging
Category: Symfony
Symfony: 6 – Routing
Routing A route is a map from a URL path to a controller. The file is usually app/config/routing.yml, but can be configured to be anything (including an XML or PHP file). You can also define routes using annotations. For example, suppose you want to match any URL like /blog/my-post or /blog/all-about-symfony and send it to
Continue reading Symfony: 6 – Routing
Symfony: 3 – Bundles
Bundles In Symfony2, a bundle is like a plugin, except that all of the code in your application will live inside a bundle. A bundle is nothing more than a directory that houses everything related to a specific feature, including PHP classes, configuration, and even stylesheets and JavaScript files. Everything is a bundle in Symfony2,
Continue reading Symfony: 3 – Bundles
Symfony: 1 – Installation
PHP 5.4 installation Using the Symfony Installer is the only recommended way to create new Symfony applications. This installer is a PHP application that has to be installed in your system only once and then it can create any number of Symfony applications. sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony sudo chmod a+x /usr/local/bin/symfonysudo curl -LsS
Continue reading Symfony: 1 – Installation
Symfony: 2 – Directory structure
Autoloading When Symfony is loading, a special file – vendor/autoload.php – is included. This file is created by Composer and will autoload all application files living in the src/ folder as well as all third-party libraries mentioned in the composer.json file. Because of the autoloader, you never need to worry about using include or require
Continue reading Symfony: 2 – Directory structure