Listing 13.24. | |
| ROZDZIAŁ: | 13. Zagadnienia dodatkowe dotyczące warstw M oraz V |
| TXT: | listing-13-24.txt |
class Actions extends ActionsBase
{
public function execute_list()
{
$q = Doctrine_Query::create()->from('Producent')->orderBy('nazwa');
$producenci = $q->fetchArray();
$this->set('producenci', $producenci);
}
public function execute_show()
{
if (
isset($_GET['slug']) &&
str_ivslug($_GET['slug']) &&
($producent = Doctrine::getTable('Producent')->findOneBySlug($_GET['slug']))
) {
$this->set('producent', $producent);
} else {
$this->execute_404();
}
}
}