public function loadModel($id) { $model = TypeCar::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public static function typeCars() { return CHtml::listData(TypeCar::model()->findAll(), 'type_car', 'name'); }
public function actionIndex() { $model = TypeCar::model()->findAll(); $this->render('index', array('model' => $model)); }