$query = new Query(); $criteria = $query->getCriteria(); $criteria->setIgnoreCase(true); $users = User::model()->findAll($criteria);
function search($text) { $query = new Query(); $criteria = $query->getCriteria(); $criteria->setIgnoreCase(true); $criteria->addSearchCondition('name', $text); $users = User::model()->findAll($criteria); return $users; }This code defines a search function that finds users whose names match a given text string. The setIgnoreCase criteria is used to ensure that the search is case-insensitive. Package/library: Yii Framework.