Componette

Componette

rixxi

rixxi / latte-filters

Clean up your prepareTemplateFilters! But seriously don't do it!

download-cloud-line composer require rixxi/latte-filters

You can now stop spamming prepareTemplateFilters and setup with template runtime helpers setup! This extension allows you to add dynamic filters (runtime helpers and helper loaders) to latte engine just by tagging service.

class DynamicHelperWithFewFilters
{

	function money($value) { /* ... */ }

	function formatTime($value) { /* ... */ }

}
service:
	-
		class: DynamicHelperWithFewFilters
		tags:
			latte.filter: [ money, formatTime: time ]

	-
		class: DynamicHelperLoader
		tags: [ latte.filterLoader ]

extensions:
	latteFilters: Rixxi\LatteFilters\DI\LatteFiltersExtension

No release at this moment. Try to create first one.

price-tag-2-line

Badges

guide-fill

Dependencies

Componette Componette felix@nette.org