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 20 comments
Just a small notice, for those, who hasn't get to know this yet (I was surprised): Popovers doesn't work under Internet Explorer 9 and earlier.
Tested them to work like a charm under newest FF and Chrome, but no luck under IE.
When a button doesn't have a label text, but has an icon, there is an horizontal white line that appears when you hover the mouse over the button. This happens on Firefox but not in Google Chrome. Please see the screenshot: http://i.imgur.com/DSHU7.png Can this be fixed? thank you!
A button that has an icon but no label (text), has a smaller size than those that have a label. Is this a bug? I'd like to have an "accept" button with label text, and another one to "cancel" but with just an icon and no label text, but the size is different unless I add text to the icon-only button... any ideas? thank you.
@bigxu it's an open issue I will fix in future versions. Thanks!
http://boot2.dev2.bigxu.com/index.php?r=site/contact
@ykee
Let me get this straight... you followed the steps provided in the installation section and you get that error message?
What version of Yii are you using? Have you by any change modified the core files of the framework?
Also, if possible, please use this form to submit individual bug reports. Keeping track of bugs here, in the comments, is not that easy. Thank you for your understanding!
Hi
It's incredible better solution than "bootrap" ext (http://www.yiiframework.com/extension/bootstrap) where ewerything is a widget... I don't know why...
But i have some problem, when I load standard web application, i have some errors: "Declaration of BHtml::linkButton() should be compatible with that of CHtml::linkButton()"
etc.
Do you know how to solve this problem?
Regards
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?
Leave a comment
Please login to leave your comment.