Using filters with CGridView and CArrayDataProvider

Comparing #6 with #7

Revision #7 was created by yugene yugene on Oct 22, 2013, 6:32:36 AM.

full comparison is fixed (wrong order of vars / or wrong comparison at second level conditions were used)

Content

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


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