Listing 14.22. Metoda akcji img/show - project 14.2
public function execute_show()
    {
        if (
            isset($_GET['slug']) &&
            (str_ivslug($_GET['slug'])) &&
            ($img = Doctrine::getTable('Img')->findOneBySlug($_GET['slug']))
        ) {
            $this->noLayout();
            header('Content-Type: image/png');
            echo $img['img'];
        } else {
            $this->execute_404();
        }
    }
