Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class AdminController extends CController
- {
- abstract public function getModel($scenario);
- public function actionCreate()
- {
- $model= $this->getModel('');
- if(isset($_POST[get_class($model)]))
- {
- $model->attributes=$_POST['Users'];
- if($model->save())
- $this->redirect(array('view','id'=>$model->id));
- }
- $this->render('create',array(
- 'model'=>$model,
- ));
- }
- }
- class DefaultController extends AdminController
- {
- public function getModel($scenario)
- {
- return new Users($scenario);
- }
- }
Add Comment
Please, Sign In to add comment