Reputation: 258
I saw few different solutions to implement twitter bootstrap with cakephp
My question is - what the best solution of them???
I wish to use for my app latest versions of cakephp and twitter bootstrap.
Solution that I need is to bake app and after that views must be already working with twitter bootstrap (so additional helpers for twitter bootstrap is not a good solution). What I found is:
Can anyone who already tried to find best solution for this tell me what he/she found???
Thanx.
Upvotes: 3
Views: 2384
Reputation: 1
I recommend you check it out CakeStrap (https://github.com/Rhym/cakeStrap)
This are the really easy steps to follow:
1) Download the .zip file
2) The files have been placed in the folders that will already be in your cakePHP app, simply follow the rabbit hole and place the folders/files in their correct locations: - The "Templates" folder goes in app/Console - The "Themed" folder goes in app/View
3) To enable your theme add public $theme = "Cakestrap"; to your "AppController" class.
4) If you would like to generate your app with the bakery then make sure you have enabled your theme before running the script.
Cheers!
Upvotes: 0
Reputation: 151
I just thought that it would be useful for others who stumble upon this question thread to know that someone did put together something for the community. You'll find it here: https://github.com/vz28bh/CakePHP-Bootstrap-Templates
Upvotes: 2
Reputation: 557
This is what I use to create forms in my views compatible with Twitter Bootstrap:
echo $this->Form->create('User', array(
'inputDefaults' => array(
'div' => 'control-group',
'label' => array('class' => 'control-label'),
'between' => '<div class="controls">',
'after' => '</div>',
'class' => '',
'error' => array('attributes' => array('wrap' => 'div', 'class' => 'alert alert-error'))),
'class' => 'form-horizontal'));
echo $this->Form->input('login');
echo $this->Form->end();
This is the final output:
<form action="path/to/action" class="form-horizontal" id="UserForm" method="post" accept-charset="utf-8">
<div style="display:none;">
<input type="hidden" name="_method" value="POST">
</div>
<div class="control-group required">
<label for="UserLogin" class="control-label">Login</label>
<div class="controls">
<input name="data[User][login]" class="" maxlength="255" type="text" id="UserLogin">
</div>
</div>
</form>
Upvotes: 0
Reputation: 20102
I think the best solution is to change the HTML of the bake templates, and then share your templates with the community n_n
Upvotes: 0