CakePHP with Bootstrap (from Twitter)

Paulo Coghi picture Paulo Coghi · Nov 8, 2011 · Viewed 8.7k times · Source

I am new to CakePHP and I want to know a way to use Boostrap from Twitter in layouts combined with cake.

My main concern is to make the Form Helper continues to function normally, because I think that it uses pre-configured CSS classes, and if I change the default css, I imagine that the Form Helper will stop to work as it should.

I read this tutorial but it doesn't seems to be complete.
Build a PHP application using CakePHP and (twitter) Bootstrap, Part 1

Has anyone done this?

Thank you! :D

Answer

Ross picture Ross · Nov 8, 2011

CSS is purely presentational; how can it affect the form helper from working as it should?

Some of the CSS validation classes might need reworking as well as what Cake returns when an error is encountered.

You can easily modify the output using the error option:

$this->Form->input('Model.field', array('error' => array('wrap' => 'span',
                                              'class' => 'boostrap-error')));

http://book.cakephp.org/view/1401/options-error