symplify / modular-latte-filters
This package is abandoned and no longer maintained.
The author suggests using the contributte/latte package instead.
Nette extension for modular Latte filters loading.
v2.0.0-RC3
2017-04-14 20:23 UTC
Requires
- php: ^7.1
- latte/latte: ^2.4
- nette/di: ^2.4
Requires (Dev)
- nette/application: ^2.4
- nette/bootstrap: ^2.4
- phpunit/phpunit: ^6.0
- tracy/tracy: ^2.4
This package is auto-updated.
Last update: 2022-03-08 10:48:50 UTC
README
Install
composer require symplify/modular-latte-filters
Register the extension:
# app/config/config.neon extensions: - Symplify\ModularLatteFilters\DI\ModularLatteFiltersExtension
Usage
Create class implementing Symplify\ModularLatteFilters\DI\FiltersProviderInterface
:
namespace App\Modules\SomeModule\Latte; use Symplify\ModularLatteFilters\DI\FiltersProviderInterface; final class SomeFilters implements FiltersProviderInterface { public function getFilters() : array { return [ 'double' => function ($value) { return $value * 2; } ]; } }
Register it to config.neon
:
# app/config/config.neon services: - App\Modules\SomeModule\Latte\SomeFilters
Use in any template:
{* app/templates/Homepage/default.latte *} And your self-esteem is {$selfEsteem|double}
That's it!
Contributing
Send issue or pull-request to main repository.