Yii Framework

How to create a back link using the Yii…

In the view that you wish to use add the following code for the back link. CHtml::link('Back',Yii::app()->request->urlReferrer);
Ian Carnaghan
5 sec read

Getting error: Bad Request The CSRF token could not…

Getting error: Bad Request The CSRF token could not be verified: when CSRF has been enabled in the Yii Framework and I’m clicking on a linkButton within...
Ian Carnaghan
16 sec read

How to create a Email link using the Yii…

In the view that you wish to use add the following code for the Email link. CHtml::mailto($data->email) NOTE: $data->email contains the email address, replace this variable...
Ian Carnaghan
9 sec read

How to include JQuery in the Yii Framework

You can add the below code anywhere in your Yii Application and JQuery will be included in the rightful place in your application Yii::app()->clientScript->registerCoreScript('jquery');
Ian Carnaghan
6 sec read

How to disable JQuery in the Yii Framework 1.1.x

Include the following code anywhere in your application   
Ian Carnaghan
14 sec read

How to get the server name using the Yii…

Use the code below to obtain the server name Yii::app()->request->serverName
Ian Carnaghan
3 sec read

How to get the user’s IP Address using the…

The Host Address server variable forms part of the Server and execution environment information set To get the user’s IP ADDRESS within the Yii Framework use the following code echo Yii::app()->request->userHostAddress; This can be...
Ian Carnaghan
10 sec read

How to get the QUERY STRING using the Yii…

The QUERY STRING server variable forms part of the Server and execution environment information set To get the QUERY STRING within the Yii Framework use the following code echo Yii::app()->request->getQueryString(); //The same as echo...
Ian Carnaghan
11 sec read

How to get the request URI using the Yii…

The Request URI server variable forms part of the Server and execution environment information set To get the URI within the Yii Framework use the following code echo Yii::app()->request->getRequestUri(); //The same as echo $_SERVER;...
Ian Carnaghan
11 sec read