flame / thumbnail-helper
Nette template helper for lazy creating of thumbnails
v3.0
2013-08-26 08:51 UTC
Requires
- php: >=5.3.2
- flame/module-installer: >=0.1.2
- flame/modules: >=0.6.0
- nette/nette: >=2.0.1
This package is not auto-updated.
Last update: 2024-11-18 13:57:48 UTC
README
Nette template helper for lazy creating of thumbnails
###Instalation Examples is based on Nette version 2.0.12, but the package is compatible with @dev version too
##Register "thumb" extension In bootstrap.php
\Flame\Thumb\DI\ThumbExtension::register($configurator);
###Register "thumb" helper
/** * Base presenter for all application presenters. */ abstract class BasePresenter extends Presenter { /** * @param null $class * @return \Nette\Templating\ITemplate */ protected function createTemplate($class = null) { $template = parent::createTemplate($class); /** @var \Flame\Thumb\IRegister $thumb */ $thumb = $this->context->getByType('Flame\Thumb\IRegister'); $thumb->register($template); return $template; } }
###Set variables (Optional) In config.neon
thumb: paths: base: %wwwDir% thumbs: /media/thumbs
That's all! Enjoy it!