public function showAction() { $Artykul = new Application_Model_DbTable_Artykul(); $slug = $this->getRequest()->getParam('slug'); $select = $Artykul->select()->where('slug = ?', $slug); $this->view->artykul = $Artykul->fetchRow($select); if (!$this->view->artykul) { throw new Zend_Controller_Action_Exception('Błąd #1!', 404); } }
Listing 21.9. Metoda showAction() akcji indexshow
Rozdział 21. Identyfikacja rekordów na podstawie wartości slug