This had me stumped for a while so I figured it would be nice to share here to avoid others the grief.
This had me stumped for a while so I figured it would be nice to share here to avoid others the grief.
Gii provides us normally with the following code on the 'actionCreate':
public function actionCreate()
{
$model=new ModelName;
Relational databases do not support inheritance so if we need to represent it, we have to somehow store meta info while keeping performance by minimizing JOINs. One way to solve this problem is using single table inheritance. All fields for the whole class tree are stored in a single table. Class name is stored in the type field...
I have had to do this a couple of times now so I figured I would share it with the community. I am going to keep this short because I really hope that you are familiar with jQueryUI's Sortable class before starting this tutorial.
Original source code and idea are from: PHP, PDO & Nested Transactions.
Something a good application cant miss is documentation, and what would be better than some nice formatted HTML documentation that can be auto-generated from your code, we know several tools that already do this like phpDocumentor, but today we are introducing Yii Docs Generator...
This article will explain how to create a REST API with the Yii framework.
Some times the core validation rules provided by Yii won't satisfy all your needs, so you'll need to create your very own validation rule.
The easiest way to customize look and behaviour of them is to use series of CButtonColumn properties, like: updateButtonImageUrl (path to image for update button), updateButtonLabel (label for the update button; not HTML-encoded), updateButtonOptions (HTML options for this button, used in the way as many htmlOptions property for many widgets) and updateButtonUrl (a PHP expresion th...
YII_DEBUG
to true (by default, it is defined in index.php
)
and put alongside error_reporting(E_ALL);
.
Then errors and warnings will stop the execution an...This is a reference to be used for Model rule validation and is compiled from the Yii documentation and code. The purpose is to have all the information gathered in one place instead of scattered. This reference is not an intro. See The Definitive Guide to Yii, Declaring Validation Rules for a tutorial.