Wiki

Articles in category "tutorials", sorted by viewsX
Displaying 71-80 of 254 result(s).

Using CAutoComplete to display one value and submit another

Created 8 years ago by luoshibenTutorials5 comments – viewed 51,765 times – ( +8 / -4 ) – version 1.1
Note: CAutoComplete is deprecated since Yii 1.1.3. Consider using CJuiAutoComplete.

How to use ldap in UserIdentity for authentication

Created 7 years ago by BeerSercTutorials15 comments – viewed 51,120 times – ( +14 / -1 ) – version 1.1
Yii does not have an LDAP class itself, but its very easy to implement LDAP in the stock UserIdentity class.

Use shortcut functions to reduce typing

Created 8 years ago by qiangTutorials8 comments – viewed 49,986 times – ( +58 / -1 ) – version 1.1
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 the problem of these lengthy typings, it is worthwhile to define global shortcut functions to some commonly used method calls. They will make the application code look cleaner.

Creating a database-driven hierarchical Structure combined with CMenu and superfish

Created 7 years ago by thyseusTutorials9 comments – viewed 48,840 times – ( +15 / -1 ) – version 1.1
Note: Please also take a look at the newer EMenu extension. This works even better that the deprecated CDropDownMenu!
tags: menu

Drills : Search by a HAS_MANY relation in Yii 1.1

Created 4 years ago by softarkTutorials13 comments – viewed 47,977 times – ( +34 / -1 ) – version 1.1
Sometimes we get lost trying to search by a HAS_MANY relation using CActiveRecord or CActiveDataProvider in Yii 1.1. This article is a series of drills that try to describe the practical techniques of searching by a HAS_MANY relation.

A simple way to get Yii client-side form validation run when submitting by ajax

Created 4 years ago by nlacTutorials5 comments – viewed 47,927 times – ( +8 / -3 ) – version 1.1
A time ago i've met the issue that Yii doesn't run any client-side form validation when submitting the form by CHtml::ajaxSubmitButton. The small javascript below helps to fix it.

How to log changes of ActiveRecords?

Created 8 years ago by pfthTutorials7 comments – viewed 47,535 times – ( +41 / -3 ) – version 1.1
A simple and effective way to keep track what your users are doing within your application is to log their activities related to database modifications. You can log whenever a record was inserted, changed or deleted, and also when and by which user this was done. For a CActiveRecord Model you could use a behavior for this purpose. This way you will be able to add log functionality to ActiveRecords very easily.
tags: Logging

Drills : Search by a HAS_MANY relation in Yii 2.0

Created 2 years ago by softarkTutorials4 comments – viewed 47,401 times – ( +19 / -1 ) – version 2.0
This article tries to describe the practical techniques of searching by a HAS_MANY relation using ActiveRecord of Yii 2.0.

Exporting CGridView results to CSV file

Created 5 years ago by RusAlexTutorials9 comments – viewed 46,769 times – ( +6 / -4 ) – version 1.1
A few days ago, i worked for CGridView exporting functional for my client. He asked me to create a simple exporting to a CSV file a CGridView search results.
tags: cgridview, export, csv

Editing, Deleting, and Viewing model data with the yii2-detail-view extension

Created 3 years ago by Kartik VTutorials1 comment – viewed 45,558 times – ( +37 / -2 ) – version 2.0
The yii2-detail-view extension offers you an easy way to EDIT and VIEW your model data, toggle these modes, and adds other features. You can read the extension documentation and/or view a demo of this extension, to understand usage.