Posted by & filed under General.

It’s easy but make sure you have MySQL and php5-fpm installed with Homebrew.

After that you can run following commands

MySQL:

php-fpm:

I have created bash scripts for this and put them to /usr/sbin/php-restart and /usr/sbin/mysql-restart.

Contents for such scripts are:

/usr/sbin/php-restart:

/usr/sbin/mysql-restart:

After that I can simply type “sudo php-restart” and “sudo mysql-restart”.

Easy :)

Posted by & filed under Symfony.

Few days ago I decided to use free Twitter Bootstrap themes from bootswatch.com.

In my Symfony 1.4 project I use a lot of Symfony Forms and I needed to adjust them according to Twitter Bootstrap 3.0 rules.

So I created custom sfWidgetFormSchemaFormatter:

There is important thing in this class on lines 18-22:

 

Here we have adjustment of the text input field with Twitter Bootstrap form class, to make it 100% width. You can also adjust other form controls by checking class names of the form widgets.

Hope this saved some time for you, enjoy!

Posted by & filed under General, Symfony.

I had a case recently – the registration form with alternative email and secret question.
In this form user needed to enter alternative email OR/AND secret question for password reminder function – at least one field must be filled. So I used approach of adding form validators dynamically.
Read more »