Код: Выделить всё
public function actionCreate()
{
$model=new Ads;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
//категории
[b]$categories = Category::model()->findAll();[/b]
if(isset($_POST['Ads']))
{
$model->attributes=$_POST['Ads'];
if($model->save())
$this->redirect(array('view','id'=>$model->id));
}
$this->render('create',array(
'model'=>$model,
'cat'=>$categories,
));
}
И ничего не получаю. Возврщает NULL.
Что то делаю не правильно. Но не могу понять что?