PHP Frameworks Archives - Ian Carnaghan

Disabling the Layout and the View in cakePHP

To disable the view and the layout in cakePHP set autoRender to false within the appropriate action in your controller $this->autoRender = false; To only disable the layout in cakePHP set the layout to false $this->layout = false; And to only disable the view for an action call the render method and...

Mar 22 · 13 sec read >

How to check in Controller which validation rule failed in cakePHP

Put the code below in your controller and replace the model name with the appropriate model name against which...

Mar 22 · 10 sec read >

How to find the value of a single field in cakePHP

Use the model method field if no matching data is found it returns false. Example   $this->Model->id = 10;   $this->Model->field('name');...

Mar 22 · 10 sec read >

How to create a back link using the Yii Framework

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

Mar 22 · 5 sec read >

Getting error: Bad Request The CSRF token could not be verified: when CSRF has been enabled in the Yii Framework

Getting error: Bad Request The CSRF token could not be verified: when CSRF has been enabled in the Yii Framework...

Mar 22 · 16 sec read >

How to create a Email link using the Yii Framework

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...

Mar 22 · 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...

Mar 22 · 6 sec read >

How to disable JQuery in the Yii Framework 1.1.x

Include the following code anywhere in your application    <span id="urn:enhancement-f9965c67-8856-e15b-a96a-9ae613690f5b" class="textannotation">Yii</span>::<span id="urn:enhancement-0ff1ff82-84ee-005a-2d01-4a27dedfa994" class="textannotation">app</span>()->clientScript->scriptMap=array(           'jquery.js'=>false, );

Mar 22 · 14 sec read >

How to get the server name using the Yii Framework 1.1.x

Use the code below to obtain the server name Yii::app()->request->serverName

Mar 22 · 3 sec read >