Agan-agan dan sis,ane mau buat sperti ini http://www.eha.ee/labs/yiiplay/index.php/en/person/batch sebetulnya,tapi agak bingung karena code nya kayak gini
public function actionUpdateYears()
{
// we only allow POST request
if(Yii::app()->request->isPostRequest)
{
$increment=!empty($_GET['op']) && $_GET['op']=='more' ? 1 : -1;
$criteria=new CDbCriteria();
$criteria->addInCondition('id', $_POST['person-id']);
Person::model()->updateCounters(array('birthyear'=>$increment), $criteria);
// if AJAX request, we should not redirect the browser
if(!isset($_GET['ajax']))
{
if(!$this->goBack())
$this->redirect(array('batch'));
else
$this->goBack();
}
}
else
throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
}
Person::model()->updateCounters dari mana ya?
sebenernya sih ane cuma mau ubah status,klo di klik beberapa berubah status 1 atau 2 tergantung si user,ada cara yg lebih sederhana dri ini?dan kalau ane mau bkin misal yg umurnya >18 jadi status 3 itu gimana yaa?