}
`
V. The Order model would start with:
class Order extends CActiveRecord
{
const STATUS_INITIATED = 1;
const STATUS_CANCELED = 2;
const STATUS_EXPIRED = 3;
const STATUS_PAID = 4;
public $statuses = array(
self::STATUS_INITIATED => 'Initiated',
self::STATUS_CANCELED => 'Canceled',
self::STATUS_EXPIRED => 'Expired',
self::STATUS_PAID => 'Paid',
);
// more cod...
Sometimes we get lost trying to search by a HAS_MANY relation using CActiveRecord or CActiveDataProvider in Yii 1.1. This article is a series of drills that try to describe the practical techniques of searching by a HAS_MANY relation.
Update: This wiki has been rewritten to be in line with Yii 1.1.14. Since many of the detailed complexities are now handled by Yii, the article focuses on how the crypt()
built-in function works and why it's important to use it correctly.
After creating an yii app . we need to implement permission, Authentication and Authorization .so the best way is to use the Yii users and Rights modules.
To extend further static pages as shown by Qiang http://www.yiiframework.com/wiki/22/how-to-display-static-pages-in-yii/ here're the steps to take:
When creating web-application projects, you can add a great variety of different extensions, modules, plugins or scripts to your code-base. But maintaining a stable combination and updating certain packages can become a hard task.
But in the supposedly small share of webapps that don't ask users to activate their accounts, you can end up with a number of bounce messages and non-accessible active accounts.
hi guys, Here I'm going to give you a working example of ajax form submiting in Yii.
This tutorial gives you multiple options of how to fully implement showing, sorting and filtering related data in gridviews.
CGridView (or CListView) together with CActiveDataProvider is a very powerful combination of the built-in tools of Yii. But how do they work together to accomplish their fantastic functions? And what are you expected to do to use them and to customize their behaviors? This article explains the very basics of them.
Facebook Deauthorize callback is used to getting notification to the app owner when a user uninstall our app from their fan page or profile.
This tutorial will guide you through the process of creating a yii application using Cloud9. We will use a git workspace to enable version control and also show how to link the Cloud9 workspace to GitHub.
Inspired by it I extended the CButtonColumn class like this:
This is another way to view images in your application and I like this way because it's simple and I think it's better performance than other.
Usually when we use AutoComplete in a project, We need to show "title" or "name" in the list, while when the form is posted, we need some sort of integer ID referring to the selected value. Out of the Box, CJuiAutoComplete widget doesn't provides different display text and post values.
By default, the decimal separator in php (also in mysql) is a dot (.). So when we work with floats in Yii (in calculations, validation, sql statements etc.), the decimal separator has to be a dot. If we want to use for example a comma (,) as the decimal separator, that is if we want to display numbers and enable users to enter numbers with a comma before the decimals, we have to...
This is a tutorial for how to auto set model values without any code.
This is a tutorial for how to add input text-Field, check-box, buttons in CGridView.
To start with you need to download the latest stable release of CKeditor. Extract the downloaded file and place the ckeditor/ folder in your applications webroot directory. (beside "protected" and "css" and other directories)