Showing 221-240 of 652 items.

How to add more information to Yii::app()->user

Created 17 years ago by qiang qiang, updated 14 years ago by Yang He Yang He. 2 comments

By default, the expression Yii::app()->user returns a [CWebUser] [application component](http://www.yiiframework.com/doc/guide/basics.application#application-component) which represents the information that are closely related with the current user. Some information can be persistent throughout the current user session. For example, [CWebUser] already comes with a [name|CWebUser::name] property th...

21 0
28
Viewed: 242 261 times
Version: 1.1
Category: Tutorials

How to create a breadcrumb widget

Created 17 years ago by knut knut, updated 14 years ago by Yang He Yang He. 4 comments

Here's a simple way to create a breadcrumb widget to be used in your templates. The idea is just to isolate how the breadcrumb is generated based on an array of crumbs.

10 0
11
Viewed: 91 103 times
Version: 1.1
Category: Tutorials

    Use shortcut functions to reduce typing

    Created 17 years ago by qiang qiang, updated 14 years ago by Yang He Yang He. 8 comments

    Because Yii intends to be integrated nicely with third-party libraries, it does not define any global functions. Everything in Yii needs to be addressed with full class name or object scopes. For example, to access the current user, we need to use Yii::app()->user; to access application parameters, we need Yii::app()->params['name']; and so on. While editors like textmate can help alleviate...

    46 0
    45
    Viewed: 77 469 times
    Version: 1.1
    Category: Tutorials