Understanding "Assets"
Many newcomers to Yii ask about the assets/ directory found under the webroot, and this article means to explain why it's there and how to work with it.
Many newcomers to Yii ask about the assets/ directory found under the webroot, and this article means to explain why it's there and how to work with it.
When you define or extend a class, you can create class variables and methods in Yii just like you can in any other PHP system:
class Comment extends CActiveRecord {
public $helperVariable;
public function rules() { ... }
...
}
and then use them in the obvious way:
$var = $model->helperVariable;
$rules = $model->rules();
This part everybody understa...
I saw many posts that community newbie is confuse in image/photo upload with random name. so I post this topic covering all useful things regarding to image/photo upload(not covering image attribute related functionality)
Cookie management in Yii is easy, but may not be so obvious for the beginners to this framework, so I wrote this simple article to clear some doubts out.
A common source of confusion among new Yii users is how the 'safe' validator works, how it works with other validators, and why it's necessary in the first place. This article means to clear up this confusion, as well as explain the notion of Massive Assignment.
This page intends to provide an exhaustive guide of how to use Javascript (JS) in Yii. It does not explain how to learn coding in JS, but how to deal with it "the Yii way".
There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here:
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.
Scenarios are an extremely useful tool for separating validation tasks on any class you use derived from CModel. In this tutorial we will use CActiveRecord.
We start slowly and simple...
In this tutorial we will learn how to realize a create interface using a dialog.
hi guys, Here I'm going to give you a working example of ajax form submiting in Yii.
As seen in this post, Yii doesn't enforce how language is set and maintained within the session.
If you have to display a overview of related data in a table, you can use the CListView, create your view with table/tr/td tags and implement db-queries in the view to display detaildata of the current (master-)record.
It's very common to see new Yii users confusing the relations HAS_ONE and BELONGS_TO, and getting it wrong means you won't get proper values back. And though we'll talk about HAS_MANY as well, we're specifically omitting the MANY_MANY relation because it's a whole different animal.
These features provide endless possibilities and unbelievable flexibility, but as current documentation does not give more than a few examples, it might be difficult to fully understand their internals and requirements.
This little tutorial explains a way how you can retrieve more parameters from Yii::app()->user by adding a component that extends CWebUser and retrieves the user information from database table named User.
Ctrl+Space.Ctrl+Q.Previously there was described a way to build an application with front-end and back-end. I would like to continue this theme and suggest another way to organize directories using WebApplicationEnd behavior.
Use SQL SERVER 2000, the date format not like: yyyy/mm/dd hh:mm:ss. So I change to use SQL SERVER 2008 EXPRESS.