Skip to content

FreezyBee/NetteImagineGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quickstart

Build Status Coverage Status

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}">

About

Nette image generator using imagine package

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages