How To Send Parameter Value To The Cdbcriteria::addbetweencondition() ?

Hi, is it possible to send parameter value to the CDbCriteria::addBetweenCondition() like this code:

$c = new CDbCriteria();

$c->select = 'id, title';

$c = $c->addBetweenCondition('category_id', ':v1', ':v2');

$c->params = array(':v1'=>1, ':v2'=>5);

$model = Content::model()->findAll($c);

Why you asked? You couldn’t check this? :)

It’s seems wrong assigning:

$c = $c->addBetweenCondition('category_id', ':v1', ':v2');

Hi, I ask because someone might knows how to do it.

It’s neither possible nor necessary. CDbCriteria:addBetweenCondition() takes care about parameters and binding. It’s safe to use any values directly:

 $c->addBetweenCondition('category_id', 1, 5);

Or even:

 $c->addBetweenCondition('category_id',  Yii::app()->request->getQuery('min', 1),  Yii::app()->request->getQuery('max', 5));

Thank you phtamas :)