YII BOOTSTRAP
Yii-Bootstrap is the Yii wrapper for the lovely Bootstrap UI toolkit from Twitter. It includes a theme and several widgets for template generation.
v0.2
v0.1
Match the directory structure to that of your Yii application, by uploading themes/bootstrap to /path/to/your/app/themes and protected/extensions/bootstrap-theme to ext (/path/to/your/app/protected/extensions).
After that, you will have to do the following modifications to your application's files
Add these lines to your base controller class (usually found in protected/components/Controller.php
public function init() { $this->attachBehavior('bootstrap', new BController($this)); ... }
And the following lines in the application config
return array( // this row should already exist ... 'theme'=>'bootstrap', ... 'import' => array( ... 'ext.bootstrap-theme.widgets.*', 'ext.bootstrap-theme.helpers.*', 'ext.bootstrap-theme.behaviors.*', ), ... 'modules' => array( ... 'gii' => array( ... 'generatorPaths'=>array( 'ext.bootstrap-theme.gii', ), ), ... ), ... );
You can now extend the base application by overwriting the files in themes/bootstrap or add new functionality using gii. Code generators have been set up in order to make all new views look Bootstrap-themed.
Have a bug? Please create an issue here on GitHub!
https://github.com/tetele/Yii-Bootstrap/issues
Tudor Sandu
Copyright (c) 2011, Tudor Sandu. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Total 15 comments
I forgot to mention it here in the comments as well. v0.2 is out, with upgrade to Bootstrap 2 and more widgets. Also installation process is simpler.
very nice :)
new version v1.4 from twitter released
please update
yes, i know i can, but my skill with git is none, never tried...
also there are some form components missing, like checkboxList and radoButtonList
I'll implement these in v0.2. Just so you know, you can fork the code from github anytime you want and edit it, then send back a pull request.
Hi again,
error is simple
bootstrap.css and application.css
have a redefenition of .content
application use it for main content and bootstraps for .popover .content
how to fix: i have rename my html and css to .maincontent under application.css
bug: margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
its a twitter bootstraps bug because they use that in thier demos...
in view:
be free to use, include, modify, what you want ;)
in view:
be free to use, include, modify, what you want ;)
i think css from popovers are missing/bugged
because black border dont show for content
only title and footer line have a black border that means content left and right have no border
also i will post my contriution on this:
@sn4k3 I'll be looking into it, thanks for the bug report.
Hi,
CRUD form and controller generates great but filters dont work
the spin img shows forever and results never got filter but if you use advanced search it works!
Thanks
@snake @gsd great suggestions, guys, thanks! I'll make sure and include them in the next version.
@volkmar sounds like a good idea upfront, but i've never worked with behaviors before. I'll have to study them a bit first. Thanks for the tip!
How about it with a behavior class to extend an controller as a part of the code libraray?
Widget code:
In view:
Menu array:
hi,
congrats on this extension
will be great set a variable in config to indicate what folder will hold assets
how we have: theme/name/js theme/name/css and so...
i like to put all this inside a resources folder
so:
theme/name/resources/js theme/name/resources/css
Thanks
Leave a comment
Please login to leave your comment.