Listing 14.23. Metoda akcji plik/show - projekt 14.2
public function execute_show()
{
    if (
        isset($_GET['slug']) &&
        ($plik = Doctrine::getTable('Plik')->findOneBySlug($_GET['slug']))
    ) {
        $this->noLayout();
        header('Content-Type: ' . $plik['typmime']);
        echo $plik['dane'];
    } else {
        $this->execute_404();
    }
}
