My dear friend today I am going to show you a very simple thing in Yii frame work..That is to change the outlook apperance of the
Output page of the Yii framework.
Come with me I will show the way..
First you should know the place where all the file relavent to the page decoration is placed..
C:\wamp\www\yii\myyii\protected\views\layouts
inside the layout folder you will be able to see main.php and you will see the page design at there.
Now we need to find the place of where the all css files have been placed.
C:\wamp\www\yii\myyii\css is the place where your all the css files have been placed...
Ok..let us go to change the out look of the index.php page...
In address bar of web browser type
http://localhost/yii/myyii/index.php Here myyii is my project I have created.
And you will see the below output with white body...
But I need the out be with green colored background...
It is my task.It is easy to do....
First I need to create a css file and save it in C:\wamp\www\yii\myyii\css directory....
body{
background-color:green;
}
Type above code in a text editor file and save it in above dirctory as color.css
Then I have to link this color.css file to the main.php page in C:\wamp\www\yii\myyii\protected\views\layouts directory.
Open the main.php file first...
Then add the below codes to link the color.css file.
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/color.css" />
Then again type http://localhost/yii/myyii/index.php in address bar.you will the below output with green backgrounnd as below....
Output page of the Yii framework.
Come with me I will show the way..
First you should know the place where all the file relavent to the page decoration is placed..
C:\wamp\www\yii\myyii\protected\views\layouts
inside the layout folder you will be able to see main.php and you will see the page design at there.
Now we need to find the place of where the all css files have been placed.
C:\wamp\www\yii\myyii\css is the place where your all the css files have been placed...
Ok..let us go to change the out look of the index.php page...
In address bar of web browser type
http://localhost/yii/myyii/index.php Here myyii is my project I have created.
And you will see the below output with white body...
But I need the out be with green colored background...
It is my task.It is easy to do....
First I need to create a css file and save it in C:\wamp\www\yii\myyii\css directory....
body{
background-color:green;
}
Type above code in a text editor file and save it in above dirctory as color.css
Then I have to link this color.css file to the main.php page in C:\wamp\www\yii\myyii\protected\views\layouts directory.
Open the main.php file first...
Then add the below codes to link the color.css file.
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/color.css" />
Then again type http://localhost/yii/myyii/index.php in address bar.you will the below output with green backgrounnd as below....
Try to change the other appearance as you want.....
Bye..Have a nice day......