Listing 14.14. Metoda akcji img/show
public function execute_show()
{
    if (
        isset($_GET['slug']) &&
        (str_ivslug($_GET['slug'])) &&
        ($img = ImgPeer::retrieveBySlug($_GET['slug']))
    ) {
        $this->noLayout();
        header('Content-Type: image/png');
        echo stream_get_contents($img->getImg());
    } else {
        $this->execute_404();
    }
}
