Search code examples
twitter-bootstrapyiiyii-extensions

Property "TbMenu.itemCssClass" is not defined


I'm getting this error with the latest version of the bootstrap extension when using the TbMenu widget

Property "TbMenu.itemCssClass" is not defined


if ($this->itemCssClass !== null)
  $classes[] = $this->itemCssClass;

Also, I don't get the error on my local machine, only on a live server. Does anyone have any ideas what's going on?


Solution

  • itemCssClass property is inherited from zii.widgets.CMenu class which was added since YII v1.1.9, so for older version of YII it is not available. As quick fix for this issue you can change line 66 in {extensions}/bootstrap/widgets/TbBaseMenu.php file to:

    if (isset($this->itemCssClass) && $this->itemCssClass !== null)
    

    but it is highly recommended to upgrade your YII installation to the latest stable version.