przewiń do treści

Zend Framework od podstaw

Włodzimierz Gajda

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initAdresy()
    {
        $router =
            $this->bootstrap('frontController')
                 ->getResource('frontController')
                 ->getRouter();

        $route = new Zend_Controller_Router_Route_Regex(
            'teksty/([0-9]+)\.html',
            array(
                'controller' => 'index',
                'action' => 'show'
            ),
            array(
                1 => 'piosenka_id'
            ),
            'teksty/%s.html'
        );
        $router->addRoute('piosenka_show', $route);
    }
}

Listing 20.13. Definicja reguły adresu piosenka_show w klasie Bootstrap

Rozdział 20. Akcja show — wyświetlanie szczegółowych danych rekordu

listing-20-13.txt