Код в Controller:
Код: Выделить всё
class PromocodeController extends Controller {
public function accessRules() {
return array(
array('allow',
'actions' => array('index', 'submit'),
'roles' => array('user'),
),
);
}
public function actionIndex() {
$model = new Promocode();
$this->render('index', array(
'model' => $model
));
}
public function actionSubmit(){
...
...
...
...