/** * Add a new state */ public function actionCreate() { // Check Access checkAccessThrowException('op_usstates_addpages'); $model = new USState(); if (isset($_POST['USState'])) { $model->attributes = $_POST['USState']; if ($model->save()) { fok(at('State Created.')); alog(at("Created State Record '{name}'.", array('{name}' => $model->name))); $this->redirect(array('state/index')); } } // Add Breadcrumb $this->addBreadCrumb(at('Creating New State')); $this->title[] = at('Creating New State Record'); // Display form $this->render('form', array('model' => $model)); }