Hello everyone.
I am implementing a LetterPagination and i found the following problem when trying to bind a parameter in a condition that uses LIKE. The code is:
<?php
class LetterPagination extends CComponent {
public $pageVar = 'letter';
public $filterColumn = 'name';
/**
*
* @param CDbCriteria $criteria
* @return
*/
public function applyFilter($criteria) {
$criteria->condition = "{$this->filterColumn} LIKE ':letter%'";
$criteria->params = array(':letter' => $_GET['letter'];
$criteria->order = "{$this->filterColumn} ASC";
}
}
?>
there is something wrong in the code above?
YII doesn’t run the query correctly. The return is an empty set of records.
Maybe a bug on bind?
Tks!!