Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuration of global options #7

Open
wants to merge 4 commits into
base: 0.x
Choose a base branch
from

Conversation

artjomsimon
Copy link

@artjomsimon artjomsimon commented Jan 9, 2019

Hi, this PR builds on top of PR #5 , but goes one step further: Allow to configure global options that are evaluated on each of your twig function calls, but can be overwritten optionally.

Example from production:

Before

{{ cloudinary_url('folder/image', {'secure' : true, 'type': 'private', 'sign_url' : true, 'version': globally_set_sha_hash}) }}

After

config.yml:

speicher210_cloudinary:
    url: "cloudinary://%cloudinary_key%:%cloudinary_secret%@%cloudinary_name%"
    options:
      secure: true
      sign_url: true
      type: private
      version: '%release_sha%'

template.html.twig:
{{ cloudinary_url('folder/image') }}

You can still set options on a case-by-case basis if you don't want the global options to be evaluated for one particular resource.

@artjomsimon
Copy link
Author

Ok had to go the other route and introduce the variable consistently in the other functions as well since PHP 5.x didn't allow that $this->a::b syntax.

I'll look into the other failing tests shortly.

@dragosprotung
Copy link
Collaborator

The options are merged and passed to the various cloudinary functions.
It seems that a different approach is needed.
This options anyway are intended to be passed to the cloudinary instance.

@dragosprotung dragosprotung changed the base branch from main to 0.x April 26, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants