Showing 121-140 of 219 items.

Understanding Virtual Attributes and get/set methods

Created 15 years ago by Steve Friedl Steve Friedl, updated 14 years ago by GOsha GOsha. 20 comments

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

66 0
44
Viewed: 218 857 times
Version: 1.1
Category: Tutorials

Getting to Understand Hierarchical RBAC Scheme

Created 15 years ago by daemons daemons, updated 11 years ago by rAWTAZ rAWTAZ. 15 comments

Authentication and Authorization is a good tutorial. Among other topics, it describes basic aspects of Yii's RBAC implementation. But however hard I read the tutorial, I couldn't understand how exactly the hierarchy works. I found how to define authorization hierarchy, how business rules are evaluated, how to configure a...

47 0
56
Viewed: 136 467 times
Version: 1.1
Category: Tutorials

embed a view file of the class which implement the CAction.

Created 15 years ago by Davidhhuan Davidhhuan, updated 15 years ago by Davidhhuan Davidhhuan. 1 comment

In Yii, we can define an action class and ask the controller to instantiate it. And we always create ourselves actions class in rootPath/protected/extensions, and the view file we called in the actions class always are located in rootPath/protected/views/ControllerNAME or rootPath/themes/ThemeNAME/ControllerNAME, then when we use the same actions class in different controllers, we have to copy it...

1 1
2
Viewed: 29 315 times
Version: 1.1
Category: Tutorials