An open API service indexing awesome lists of open source software.

https://github.com/wavevision/latte-filters

☕️ Extra filters for Latte (@nette) templating engine
https://github.com/wavevision/latte-filters

filters latte latte-filters nette

Last synced: 5 months ago
JSON representation

☕️ Extra filters for Latte (@nette) templating engine

Awesome Lists containing this project

README

          

Wavevision s.r.o.


Latte Filters

[![CI](https://github.com/wavevision/latte-filters/workflows/CI/badge.svg)](https://github.com/wavevision/latte-filters/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/wavevision/latte-filters/badge.svg?branch=master&service=github)](https://coveralls.io/github/wavevision/latte-filters?branch=master)
[![PHPStan](https://img.shields.io/badge/style-level%20max-brightgreen.svg?label=phpstan)](https://github.com/phpstan/phpstan)

Set of extra [nette/latte](https://github.com/nette/latte) filters.

## Installation

Via [Composer](https://getcomposer.org)

```bash
composer require wavevision/latte-filters
```

## Contents

- [CzechMonth](./src/LatteFilters/CzechMonth/CzechMonth.php) – render months translated to Czech (incl. inflected version)
- [Email](./src/LatteFilters/Email/Email.php) – render [ProtectedEmail](./src/LatteFilters/Email/ProtectedEmail.php) addresses (HEX encoded)
- [Mtime](./src/LatteFilters/Mtime/Mtime.php) – render filenames with timestamp appeneded to bust caches

## Usage

To use all filters, simply include `common.neon` from this package in your project config:

```neon
includes:
- %vendorDir%/wavevision/latte-filters/config/common.neon
```

Alternatively, you can register only wanted filters separately, e.g.:

```neon
services:
- Wavevision\LatteFilters\CzechMonth\CzechMonth

nette.latteFactory:
setup:
- addFilter('czechMonth', [@Wavevision\LatteFilters\CzechMonth\CzechMonth, 'process'])
```