public function executeCreateRootPage() { if (!$this->getRequestParameter('slug')) { throw new Exception('Attempting to create a page with no slug. Please make sure you enter a slug in the form before submitting it.'); } $page = new sfSimpleCMSPage(); $page->makeRoot(); $page->setSlug($this->getRequestParameter('slug')); $page->setTemplate($this->getRequestParameter('template')); $page->save(); $this->redirect('sfSimpleCMSAdmin/list?page=' . $this->getRequestParameter('page', 1)); }