Wiki

Sorted by viewsX
Displaying 101-110 of 786 result(s).

Implementing a Registration Process using the yii-user-management module

Created 6 years ago by thyseusTutorials6 comments – viewed 67,105 times – ( +7 / -1 ) – version 1.1
Hi Folks,

How to log and debug variables using CWebLogRoute

Created 7 years ago by Antonio RamirezHow-tos8 comments – viewed 66,855 times – ( +18 / -1 ) – version 1.1
I have seen a couple of articles about how to integrate external libraries to debug our PHP code (i.e. firePHP) but after you read this article you will realize that there is no need for such libraries when using Yii.
tags: Logging

Special $variables in CGridView and CListView

Created 6 years ago by Steve FriedlTips11 comments – viewed 66,304 times – ( +27 / -3 ) – version 1.1
The popular CListView and CGridView widgets each take a data provider and iterate over each data object produced, calling the user's code to render each row one at a time, and most are familiar with the use of the $data variable to represent the current model object or array.

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 5 years ago by c@cbaTutorials3 comments – viewed 65,931 times – ( +28 / -2 ) – version 1.1
    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this: 'value'=>'$data->author->username',.     Now we might want to use $data in the declaration of the htmlOptions attribute, which is normally not possible, to generate for example the tag <td id="3" class="name_3">, where 3 is the id of the data model for the current row, i.e. $data->id. That is, we want to be able to use: 'htmlOptions'=>array('id'=>'$data->id', 'class'=>'"name_{$data->id}"')     Here's a way to accomplish this...

CListView AJAX filtering

Created 6 years ago by DragaTutorials17 comments – viewed 65,743 times – ( +17 / -1 ) – version 1.1
This tutorial shows how to filter CListView items by AJAX, and it's compatible with disabled JavaScript users In my case this has been done to filter users list

Using standard filters in CGridView custom fields

Created 7 years ago by GOshaHow-tos4 comments – viewed 64,745 times – ( +17 / -1 ) – version 1.1
In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.For example: We have a record in a database with field switch having 0 or 1 values. After that we want a user to see on or off instead 1 or 0. So we do the usual thing:

RBAC Super Simple with Admin and User

Created 3 years ago by evercodeTutorials11 comments – viewed 64,639 times – ( +17 / -4 ) – version 2.0
One of the common requests I see in the forum is how to implement RBAC. While you can implement Yii 2's built-in RBAC, that might be too much for developers who are just starting with Yii 2 or have simpler needs. Sometimes you are looking for a fast solution and just want two flavors, user and admin. And even if you will eventually need more, you can use these methods as a starting point for developing your own features or move on to Yii 2's RBAC.

Displaying image in a CGridView column.

Created 5 years ago by sirin kHow-tos5 comments – viewed 64,495 times – ( +13 / -2 ) – version 1.1
This is a simple example of how we can display images in CGridviews.Imagine that you have an image field in your table ie either a location field or a blob type field used to store the images.
tags: CGridView, image

How to use Multiple instances of the same model in the same form

Created 5 years ago by kiran sharmaHow-tos21 comments – viewed 64,481 times – ( +22 / -7 ) – version 1.1
When i had created this functionality then i found some difficulties and not got much idea from wiki and forums. so, i think this will be useful for newbie users and save time of other developers when create related functionality. I refer Collecting Tabular Input tutorial but not got clear idea for create/update.

How to display static pages in Yii?

Created 8 years ago by qiangTutorials2 comments – viewed 64,460 times – ( +19 / -1 ) – 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