Create By: Jaime Marcelo Valasek
Use this module to generate thumbnail to apply the images on your website.
Futures video lessons poderam be developed and posted on the website or in http://www.zf2.com.br/tutoriais Youtube channel http://www.youtube.com/zf2tutoriais
Download this module into your vendor folder.
After done the above steps, open the file config / application.config.php. And add the module with the name JVPhpThumb.
- Add this project and JVConfig in your composer.json:
"require": {
"jaimevalasek/jv-php-thumb": "dev-master"
}
- Now tell composer to download JVPhpThumb by running the command:
php $ php composer.phar update
<?php
return array(
'modules' => array(
// ...
'JVConfig',
'JVPhpThumb',
),
// ...
);
- Create a folder in the root of the site Imagecache
- Search the Internet or develop an image to display as image not found in case of missing image folder root / img / image_not_found.jpg
- Configure the folders of images to use when generating the thumbs, these settings are in the file module.config.php
return array(
// ...
'php_thumb' => array (
'thumbnail_folder' => array(
'produto-pagina-inicial' => '/conteudos/imagens/'
),
'cache' => true,
),
// ...
);
// View Code < img alt="imagem" src="/thumbnail/nameModuleConfigFolder/250/150/8:5/imagem.jpg" >
exemplo da url htttp://www.seusite.com.br/thumbnail/produto-pagina-inicial/250/150/8:5/imagem.jpg htttp://www.seusite.com.br/thumbnail/name_thumbnail_folder/width/height/ratio/image