Skip to content

v0.1.0 - Initial Release

Choose a tag to compare

@trejjam trejjam released this 31 Dec 09:41
· 9 commits to main since this release
53ee56b

🎉 Initial Release

Features

  • Nette DI Extension: Automatic Latte extension registration via DI container
  • Composer Auto-Discovery: Zero-configuration setup - just composer require trejjam/latte
  • JSON Filter: HTML-safe encoding with options (pretty, ascii, forceObjects)
  • Hash Filters: MD5 and SHA1 hash generation
  • Latte 3 Compatible: Built with Latte 3 Extension API

Components

  • TrejjamLatteExtension: Latte 3 extension providing filters
  • DI\LatteExtension: Nette DI CompilerExtension for automatic registration
  • Comprehensive test suite with 41 test cases
  • PHPStan level max compliance
  • ECS code style enforcement

Installation

composer require trejjam/latte

For Nette users with DI container - that's it! The extension is automatically registered via Composer auto-discovery.

Requirements

  • PHP 8.2, 8.3, 8.4, or 8.5
  • Latte 3.0.20 or higher
  • Nette DI 3.2 or higher
  • Nette Utils 4.0 or higher

Configuration

Automatic (recommended):

composer require trejjam/latte
# Extension auto-registered, ready to use!

Manual DI extension:

extensions:
  trejjam.latte: Trejjam\Latte\DI\LatteExtension

Standalone (without DI):

$latte = new Latte\Engine();
$latte->addExtension(new Trejjam\Latte\TrejjamLatteExtension());

Available Filters

|json - JSON encoding with options

{$data|json}                      {* HTML-safe, unicode-friendly *}
{$data|json:'pretty'}             {* Pretty-printed *}
{$data|json:'pretty','ascii'}     {* Pretty + ASCII-safe *}
{$data|json:'!html'}              {* Disable HTML-safety *}

|md5 - MD5 hash

{$email|md5}  {* For Gravatar URLs, etc. *}

|sha1 - SHA1 hash

{$password|sha1}  {* Simple checksums *}

Documentation

See README.md for full documentation.

License

MIT License - see LICENSE file.