I received an error, the Path ‘ext.bootstrap.components.Bootstrap’ is invalid, make sure PHP file exists.
To fix it, I had to chmod 755 bootstrap (only the extension’s “root” directory, everything within it was fine).
I don’t know if this was maybe caused by some weird coincidence on my machine. (Might be OS X specific.)
I downloaded the .zip, it was auto-extracted by Safari, and I then just copied it into my Yii directory. Worked with all the other extensions.
But just in case, anyone who gets this error, please make sure your webserver is actually allowed to read/execute the file.
By the way, there’s a small typo in your documentation (installation): ‘coreCss’=>true // whether to register the Bootstrap core CSS (bootstrap.min.css), defaults to true
, is missing after true.
Edit:
I think two things would be helpful for the documentation:
When using white icons within BootNavmenu, use ‘icon’=>‘icon-home icon-white’.
If you want to add properties to your <a>-Tag, e.g. for using modals, you can simply do this by adding ‘linkOptions’=>array(‘data-toggle’=>‘modal’), .
I think this is not 100% obvious, also since BootNavmenu seems not to extend CMenu. (I tried to set encodeLabel to false which didn’t work.)
Thus, my first guess would have been to use CHtml::link()-options.
thanks for this info, I actually put encodeLabel "too early" in the main configuration.
I have a little suggestions for the Brand in BootNavbar.php:
At line 50:
/**
* Initializes the widget.
*/
public function init()
{
if ($this->brand !== false)
{
if ($this->brand === true)
{
$this->brand = CHtml::encode(Yii::app()->name);
}
if (!isset($this->brandUrl))
$this->brandUrl = Yii::app()->homeUrl;
}
if ($this->collapse)
Yii::app()->bootstrap->registerCollapse();
}
That way, you can either use your application’s name as the default if brand is set to true, or if you e.g. want to add a logo, you simply put your <img>-Tag there.
(Although I’m not sure if this is “nice code style” to mix boolean and string. )
Really great extension, it already helped me a lot!
I am a newbie in Yii and I would like to add to my app this bootstrap extension. I did everything by the instructions on the homepage of this extension, but I am still getting the error
CException - Bootstrap and its behaviors do not have a method or closure named "registerCoreCss".
Also, there is no need to call any methods in your main layout anymore, this is done automatically by the extension (see the example configuration on the setup page).
@christoph: The BootNavbar brand already behaves like you’d like it to, or at least it should. If you don’t set it the app name will be used, if you set it to false the brand will be hidden and if you set it to anything but false that will be shown.
I am trying to edit a module and make the layout compatible with bootstrap however i have encountered some problem which i dont understand on how can i get it implemented in bootstrap->bootMenu. attached are the code snippet hopefully someone can help me?
Yes, but there ain’t any widget for that… yet. Of course you can write the HTML yourself and it will work. Just make sure that you don’t disable the button-plugin in the component configuration.
For everyone who’s interested, I’ve pushed a branched called “bootstrap-2.0.1” which contains the latest build of Bootstrap 2.0.1 (Feb 12) which is not officially released yet.
I’ve tagged release 0.9.8 with the tag “r0.9.8” but I won’t package that release for download because with Bootstrap 2.0.1 on the horizon, I will wait until it’s released (which should be today or tomorrow) and release 0.9.9 instead.
With the new version out soon I’d like to thank everyone who helped with this project. I really appreciate it.
Personally I think that Bootstrap is good for almost any web app. There’s already some sites that are built using Bootstrap. Some look a lot like Bootstrap and some look less. Check out http://builtwithbootstrap.com/.