freezy-bee / nette-imagine-generator
Image Imagine generator for Nette Framework
Installs: 4 304
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.3
- freezy-bee/prepend-route: ^2.0
- imagine/imagine: ^1.0
- latte/latte: ~v2.8
- nette/application: ~3.0
- nette/di: ~3.0
Requires (Dev)
- nette/bootstrap: ~3.0
- nette/tester: ~2.0
- phpstan/phpstan: ^0.12
- squizlabs/php_codesniffer: ^3.0
- tracy/tracy: ~2.6
README
Requirements
- PHP 7.1+
- Nette 2.4+
- FreezyBee/PrependRoute
Installation
$ composer require freezy-bee/nette-imagine-generator
extensions: prependRoute: FreezyBee\PrependRoute\DI\PrependRouteExtension imagineGenerator: FreezyBee\NetteImagineGenerator\DI\ImagineGeneratorExtension imagineGenerator: routes: - '/generated/<id>--<crop crop>.<extension>' - '/generated/<namespace>/<id>--<width [0-9]+>x<height [0-9]+>.<extension>' - '/generated/<namespace>/<id>--<width [0-9]+>.<extension>' - '/generated/<namespace>/<id>.<extension>' providers: - App\ImageProviders\CopyProviderMock
Usage
Image MUST implements FreezyBee\NetteImagineGenerator\RequestedImagineInterface
.
<!-- using n:macro --> <!-- image, [width], [height], [params...] --> <img n:src="$image"> <img n:src="$image, 100"> <img n:src="$image, 100, 200"> <img n:src="$image, 100, 200, crop => crop"> <img n:src="$image, param => ok"> <!-- using classic macro --> <meta content="{linkSrc $image}">