/images/soap-bubble-gdc68aeb05_640.jpg

Adding symfony console support to silex application

Adding console support to Silex application Silex is a micro-framework and as such doesn’t force you to use so many components included in full stack symfony framework. But, if we want to use some of them we need to do some extra work. Install console component Installing with composer is simple, just add additional requirements for “symfony/console” to composer.json file. The full content of my composer.json file as currently is :

Cron job - running PHP in the background

Background jobs If you wish to write responsive web applications, you will need to push some operations in the background. That way you can just register request for some long running task and immediately return to the client. If you search the web, there are many ways how to achieve this, but not so many implementation are ready to do it in constraint environment of simple web hosting. My web page is hosted by GoDaddy with so called “Linux hosting with cPanel”.

Include Bootstrap in Symfony 2 application

Bootstrap {% comment %} The best tool to design nice, responsive, mobile first web applications is bootstrap framework. It is also integrated as form design theme in symfony. Before you can use it in your symfony application, you will need to install it. The easiest way is with a web front-end package manager - bower. You should install node first and then install bower with npm package manager. Then including resources in your twig templates is as easy as use asset component.

Doctrine DBAL - working with database

In this article I am going to cover using MySql database in Symfony 2 application. I will use the simplest possible database access technology PHP offers - PDO, but in slightly extended form of Doctrine DBAL. So if you want to use Doctrine ORM , this article is not right place to start. Before we begin We need some sample data in the database, so we create a database “dbsamples” with “country” table and import data from this csv file.

Installing the php_intl extension

Enabling php_intl extension If you need internationalization extension (php_intl.dll), and you have similar development environment as I have, then follow this steps: Open Ampps manager under PHP , enable internationalization extension (php_intl.dll) and click Apply. That was simple , yes ? To check if extension is available, you need to start “php -i” in command line and search for “intl” : H:\>php -i Well, I got this error: The procedure entry point __crtCreateSymbolicLinkW could not be located in the dynamic link library MSVCR110.

Symfony - demo application

Install demo application Symfony provide demo application as a learning resource. To install it just enter “demo” as parameter to “symfony” command. H:\Ampps\www>symfony demo Start demo application To start newly installed app, navigate to: http://localhost/symfony_demo/web/app_dev.php First page of application : If demo application doesn’t work as expected and you get error like this : An exception has been thrown during the rendering of a template (“The Symfony\Component\Intl\DateFormatter\IntlDateFormatter::__construct() method’s argument $locale value NULL behavior is not implemented.