public function actionCreateFields($id) { $model = ContentType::find($id); $updated = $model->createFields(); if ($updated !== false) { Yii::app()->user->setFlash('success', "Created <strong>{$updated}</strong> field(s)"); } else { Yii::app()->user->setFlash('error', "Could not create table <strong>{$model->tableName}</strong>"); } $this->redirect(array('contentType/status')); }
public function index($type = '') { $this->content = View::auto(); $contentType = new ContentType(singularize($type)); $this->content->entries = $contentType->find(); }
/** * @return \app\models\content\ContentType */ public function getContentType() { return ContentType::find($this->type); }