Allow configuration of global options
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.
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.
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.