Difference between #4 and #5 of
Using CAutoComplete to display one value and submit another

Revision #5 has been created by jonah on Mar 25, 2009, 11:57:10 PM with the memo:

implanted maximum limit
« previous (#4) next (#6) »

Changes

Title unchanged

Using CAutoComplete to display one value and submit another

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

Content changed

[...]
/* q is the default GET variable name that is used by
/ the autocomplete widget to pass in user input
*/
$name = $_GET['q'];
// this was set with the "max" attribute of the CAutoComplete widget
$limit =
min($_GET['limit'], 50);
$criteria = new CDbCriteria;
$criteria->condition = "name LIKE :sterm";
$criteria->params = array(":sterm"=>"%$name%");
$criteria->limit = $limit;
$userArray = User::model()->findAll($criteria);
[...]
7 3
11 followers
Viewed: 64 412 times
Version: 1.1
Category: Tutorials
Written by: luoshiben
Last updated by: mohammad sharif ahrari
Created on: Mar 25, 2009
Last updated: 11 years ago
Update Article

Revisions

View all history