Repository navigation
What's Changed
Bug Fixes
- Fix DI extension to gracefully handle missing Latte service (#8)
- Use
hasDefinition()instead ofgetDefinitionByType()to avoid exceptions when Latte service is not registered - Follow
contributte/vitepattern for safe Latte integration - Support both
FactoryDefinition(nette/application 3.2+) andServiceDefinition(older versions) - Register
TrejjamLatteExtensionas a proper DI service (trejjam.latte.extension) - Gracefully skip auto-registration when
latte.latteFactoryis not found - Remove unused
Latte\Engineimport
- Use
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/latteUsage
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\LatteExtensionOr register the Latte extension directly:
latte:
extensions:
- Trejjam\Latte\TrejjamLatteExtensionWhat's Next
- Future configuration options for filter behavior
- Additional utility filters based on community feedback
Full Changelog: v0.1.0...v0.2.0