findCachedBySlug() public static method

public static findCachedBySlug ( $slug )
示例#1
0
 public function contactsAction()
 {
     $page = Page::findCachedBySlug('contacts');
     if (!$page) {
         throw new Exception("Page 'contacts' not found");
     }
     $this->helper->title()->append($page->getMeta_title());
     $this->helper->meta()->set('description', $page->getMeta_description());
     $this->helper->meta()->set('keywords', $page->getMeta_keywords());
     $this->view->page = $page;
     $this->helper->menu->setActive('contacts');
 }
示例#2
0
 public function indexAction()
 {
     $this->view->bodyClass = 'home';
     $page = Page::findCachedBySlug('index');
     if (!$page) {
         throw new Exception("Page 'index' not found");
     }
     $this->helper->title()->append($page->getMeta_title());
     $this->helper->meta()->set('description', $page->getMeta_description());
     $this->helper->meta()->set('keywords', $page->getMeta_keywords());
     $this->view->page = $page;
     $this->helper->menu->setActive('index');
 }
示例#3
0
 public function indexAction()
 {
     $slug = $this->dispatcher->getParam('slug', 'string');
     $page = Page::findCachedBySlug($slug);
     if (!$page) {
         throw new Exception("Page '{$slug}.html' not found");
         return;
     }
     $this->helper->title()->append($page->getMeta_title());
     $this->helper->meta()->set('description', $page->getMeta_description());
     $this->helper->meta()->set('keywords', $page->getMeta_keywords());
     $this->view->page = $page;
 }