Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Added variables to the template classes in the config file #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

akempes
Copy link

@akempes akempes commented Jul 27, 2016

Hi,

After a few projects I noticed that I'm actually using one particular (custom) template over and over again, but the only differences are the image sizes.

I made a couple of changes in the packages to add arguments in the template definition.

'templates' => array(
    'small'     => 'Intervention\Image\Templates\Small',
    'medium'    => ['class'=>'Intervention\Image\Templates\Medium'],
    'large'     => ['class'=>'Intervention\Image\Templates\large', 'args'=>['w'=>200,'h'=>200]],
)

As you can see the changes won't break the existing configuration for this package.

I'm about to issue a pull request for the other image package as well because the applyFilter function will get a second parameter, the $args variable.

@LaurentChardin
Copy link

Sounds like a very good idea : i actually had the case and had to duplicate a lot of filters only for sizing variation.
+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants