List all the images in view (MVP) - PHP
I have worked on a small gallery app in the MVP framework (name isn't important, because it isn't famous) and I don't know, how 开发者_如何学编程to display all the images from /gal/ folder. I have something like this in my presenter - http://pastie.org/1595260
WWW_DIR - root dir
$gal_root - /gal/ folder in root
$gal_thumb - /gal/thumb/ - place, where the resized pictures are stored
$gal_orig - /gal/orig/ - place, where the original pictures are stored
I guess, $this->template
is the same as $this->view
in Zend Framework.
Then, in your view, write :
foreach($this->photos as $photo){
echo '<img src="'.$photo['thumb'].'" />'; // For thumbnail
}
If it's not the case, then you should give out the name of your framework or how it reacts.
精彩评论