public function startup() { parent::startup(); Gallery::extensionMethod('getImages', function (Gallery $gallery) { return $this->gallery->getImages($gallery->idGallery, $gallery->lang); }); //todo: Metoda getImages vrace pouze pole a ne callback? Gallery::extensionMethod('getImage', function (Gallery $gallery) { $images = array_values($this->gallery->getImages($gallery->idGallery, $gallery->lang)); return !empty($images) ? $images[0] : null; }); }
public function startup() { parent::startup(); Gallery::extensionMethod('getImages', function (Gallery $gallery) { return $this->gallery->getImages($gallery->idGallery, $gallery->lang); }); //todo: Metoda getImages vrace pouze pole a ne callback? Gallery::extensionMethod('getImage', function (Gallery $gallery) { foreach ($this->gallery->getImages($gallery->idGallery, $gallery->lang) as $path => $image) { return $path; } }); $this->setActive('Galerie'); }