Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deprecated-packages/symplifymodularlattefilters
[DEPRECATED] Use this instead →
https://github.com/deprecated-packages/symplifymodularlattefilters
filters latte modular nette symplify
Last synced: about 1 month ago
JSON representation
[DEPRECATED] Use this instead →
- Host: GitHub
- URL: https://github.com/deprecated-packages/symplifymodularlattefilters
- Owner: deprecated-packages
- License: mit
- Created: 2017-02-27T20:58:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-07T12:05:49.000Z (over 7 years ago)
- Last Synced: 2024-11-13T14:40:02.296Z (3 months ago)
- Topics: filters, latte, modular, nette, symplify
- Language: PHP
- Homepage: https://github.com/contributte/latte
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Modular Latte Filters
[![Build Status](https://img.shields.io/travis/Symplify/ModularLatteFilters/master.svg?style=flat-square)](https://travis-ci.org/Symplify/ModularLatteFilters)
[![Downloads](https://img.shields.io/packagist/dt/symplify/modular-latte-filters.svg?style=flat-square)](https://packagist.org/packages/symplify/modular-latte-filters)## Install
```sh
composer require symplify/modular-latte-filters
```Register the extension:
```yaml
# app/config/config.neon
extensions:
- Symplify\ModularLatteFilters\DI\ModularLatteFiltersExtension
```## Usage
Create class implementing `Symplify\ModularLatteFilters\DI\FiltersProviderInterface`:
```php
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`:
```yaml
# app/config/config.neon
services:
- App\Modules\SomeModule\Latte\SomeFilters
```Use in any template:
```latte
{* app/templates/Homepage/default.latte *}And your self-esteem is {$selfEsteem|double}
```That's it!
## Contributing
Send [issue](https://github.com/Symplify/Symplify/issues) or [pull-request](https://github.com/Symplify/Symplify/pulls) to main repository.