Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CakePHP with Bootstrap (from Twitter)

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

like image 380
Paulo Coghi Avatar asked Nov 08 '11 11:11

Paulo Coghi


2 Answers

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

like image 104
Ross Avatar answered Nov 07 '22 03:11

Ross


This seems to be what you are looking for. https://github.com/loadsys/twitter-bootstrap-helper/branches

like image 38
XuDing Avatar answered Nov 07 '22 01:11

XuDing