Skip to content

flame-org/Thumbnail-Helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Thumbnail-Helper

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!

About

Nette template helper for lazy creating of thumbnails

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages