Using filters with CGridView and CArrayDataProvider

Comparing #5 with #6

Revision #6 was created by marcovtwout marcovtwout on Oct 21, 2013, 9:08:34 AM.

wrong comparison operators

Content

[...]
If you want to apply full comparisons (>, <, >=, <=, =) use this


```php
if (substr($searchValue, 0, 2) == '<=') {
if (substr($searchValue, 2)
<> $compareValue) { unset($data[$rowIndex]); } } else if (substr($searchValue, 0, 2) == '>=') { if (substr($searchValue, 2) >< $compareValue) { unset($data[$rowIndex]); } } else if ($searchValue[0] == '<') { if (substr($searchValue, 1) <>= $compareValue) { unset($data[$rowIndex]); } } else if ($searchValue[0] == '>') { if (substr($searchValue, 1) ><= $compareValue) {
unset($data[$rowIndex]);
}
} else if (stripos($compareValue, $searchValue) === false) {
unset($data[$rowIndex]);
}
[...]