Yii Framework Theming

Hi,

I am new to Yii and currently, I am facing an issue with theming.

I have downloaded an admin template and installed it on my Yii application.

Based on the theming guide, I have edited the files below to reflect the theme on my pages.

Edited files:

  • new layout file in views/layout/

  • ../components/Controller.php

  • ../controllers/SiteController.php

Unfortunately, there are pages which failed to render the theme.

Could it be due to the codes below?

Not working - array(‘url’=>array(’/joborder’), ‘label’=>Yii::app()->getModule(‘user’)->t(“Job Order”), ‘visible’=>!Yii::app()->user->isGuest),

Working - array(‘url’=>Yii::app()->getModule(‘user’)->loginUrl, ‘label’=>Yii::app()->getModule(‘user’)->t(“Login”), ‘visible’=>Yii::app()->user->isGuest),

Any idea what I am missing?

Thank you in advance! :D

Solution found:

  1. Need to edit the layout in protected/controllers

    • public $layout=‘layout_name’;
  2. If you are using Yii Rights -

    Change public $appLayout = ‘application.views.layouts.main’; to

    public $appLayout = ‘//layouts/main’; in RightsModule.php

    (Reference: https://code.google.com/p/yii-rights/issues/detail?id=70)