Quantcast
Channel: Live News for Yii Framework
Viewing all articles
Browse latest Browse all 2941

[Wiki] How to Setting Layouts in Yii

$
0
0

usually someone confused to make layouts in yii.

and how do to make layouts in yii? whether to change the CSS Default? or should create a new css file? Okay I will explain a bit about how to create layouts in yii.

let us consider

The first thing you should do is download the file layouts that are small in Yii Layouts

there are several options, you can choose one layouts. example: I use the Triplets and now go to the folder Triplets / layouts / and copy files triplets.php

and paste into YourApplication / protected / views / layouts

after finished moving files to a folder triplets.php layouts, now you have to set the configuration. Now enter the folder

YourApplication / protected / components / and open the file Controller.php

after the change as below.

<?php
/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */
class Controller extends CController
{
    /**
     * @var string the default layout for the controller view. Defaults to '//layouts/column1',
     * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
     */
    public $layout='//layouts/triplets';/ / change the layouts here with triplets or others
 
    /**
     * @var array context menu items. This property will be assigned to {@link CMenu::items}.
     */
    public $menu=array();
    /**
     * @var array the breadcrumbs of the current page. The value of this property will
     * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
     * for more details on how to specify this property.
     */
    public $breadcrumbs=array();
}

completed

make it easy yeah I hope this helps

working safely.


Viewing all articles
Browse latest Browse all 2941

Trending Articles