Skip to content

v0.2.0

Latest

Choose a tag to compare

@trejjam trejjam released this 31 Dec 16:53
· 6 commits to main since this release
3df8e78

What's Changed

Bug Fixes

  • Fix DI extension to gracefully handle missing Latte service (#8)
    • Use hasDefinition() instead of getDefinitionByType() to avoid exceptions when Latte service is not registered
    • Follow contributte/vite pattern for safe Latte integration
    • Support both FactoryDefinition (nette/application 3.2+) and ServiceDefinition (older versions)
    • Register TrejjamLatteExtension as a proper DI service (trejjam.latte.extension)
    • Gracefully skip auto-registration when latte.latteFactory is not found
    • Remove unused Latte\Engine import

Previous Changes (v0.1.0 → v0.2.0)

  • Add Nette DI extension for automatic registration (#7)
  • Add comprehensive nette/tester test suite with snapshot verification (#4)
    • 37 test cases (15 unit + 22 integration tests)
    • Snapshot testing for rendered output
  • Refactor json filter to use variadic parameters with named arguments
  • Add nepada/phpstan-nette-tester for better static analysis
  • Update branch alias for v0.2.x development
  • Bump actions/cache from 4 to 5 (#5)
  • Bump actions/checkout from 4 to 6 (#6)

Compatibility

  • PHP: 8.2, 8.3, 8.4, 8.5
  • Latte: 3.0.20+
  • Nette DI: 3.2+
  • Nette Utils: 4.0+

Installation

composer require trejjam/latte

Usage

Automatic Registration (Recommended)

With Composer auto-discovery, the extension is automatically registered. Just install and use:

{* JSON filter *}
{$data|json}
{$data|json:'pretty'}
{$data|json:'pretty','ascii'}

{* Hash filters *}
{$email|md5}
{$password|sha1}

Manual Configuration

If auto-discovery is disabled:

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

Or register the Latte extension directly:

latte:
    extensions:
        - Trejjam\Latte\TrejjamLatteExtension

What's Next

  • Future configuration options for filter behavior
  • Additional utility filters based on community feedback

Full Changelog: v0.1.0...v0.2.0