Wiki

Sorted by commentsX
Displaying 371-380 of 752 result(s).

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

Created 6 years ago by qiangTutorials2 comments – viewed 139,479 times – ( +30 ) – version 1.1
By default, the expression Yii::app()->user returns a CWebUser 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 property that stores the username of the current user.

How to keep filters simple in CGridView

Created 8 months ago by PeppeHow-tos2 comments – viewed 3,243 times – version 1.1
The problem is not new: after setting some filters in a grid (typically in admin view), and gone to another page, returning in the grid's page I would like to find the filters with previous setting mantained.

File uploads in CForm (Form builder)

Created 3 years ago by Luke JurgsHow-tos2 comments – viewed 37,664 times – ( +12 ) – version 1.1
While there is a reasonable amount of documentation regarding CForm (form builder) and file uploads seperately, there really is not any coverage of both in combination.

Moving the vendor directory for multiple projects

Created 8 months ago by mariosimaremareHow-tos2 comments – viewed 5,325 times – ( +4 / -1 ) – version 2.0
This How-To is useful if you are planning to move the Yii vendor directory outside the default location.

Eclipse PDT - code-hints, references and other goodies

Created 6 years ago by mindehTutorials2 comments – viewed 27,669 times – ( +14 ) – version 1.1
Since PHP is dynamically typed language, the way IDE may help you is limited.
tags: IDE

Insert a multirow header in CGridView

Created 2 years ago by PeppeHow-tos2 comments – viewed 11,780 times – ( +6 ) – version 1.1
The CGridView widget is very useful and customizable, but sometimes you need a little more. One limit I found is to have only one row for headers; yes, you can write each column header in more than one row, but just inside the single cell. I was looking instead for the possibility to use more than one row, with different structure one from the others. This way you can write columns grouping headers, and obtain a nicer view.

Use minified version of JqueryAsset, BootstrapAsset (and all default assets)

Created 6 months ago by robregonmHow-tos2 comments – viewed 3,766 times – ( +8 ) – version 2.0
By default, Yii 2.0 chooses to use the non-minified version of Jquery and Bootstrap files (CSS and JS). However, there's a simple way to indicate Yii to use the minified version.

How to display static pages in Yii?

Created 6 years ago by qiangTutorials2 comments – viewed 53,180 times – ( +19 ) – version 1.1
In a Web application, we often need to display pages like "about this site", "legal information", whose content are mostly static. There are several approaches to deal with this kind of pages.
tags: static pages

How to implement multiple page layouts in an application

Created 6 years ago by qiangTutorials2 comments – viewed 90,373 times – ( +24 ) – version 1.1
In this tutorial, we describe how to implement multiple layouts for action views in an application. As an example, we assume that the pages in our application will use three different layouts:
tags: layout

How to use Expression in default AccessControl to allow only the owner to do some action

Created 2 years ago by whatifHow-tos2 comments – viewed 24,482 times – ( +8 / -1 ) – version 1.1
Hi Everyone