Reputation: 1461
I have an Expression Engine plugin that has a file parameter for example:
{exp:my_plugin file='/css/css.js'}
I can get the parameter in the plugin using
$file = $this->EE->TMPL->fetch_param('file');
Is there a way to process $file
to replace any tags, i.e. global variables and snippets, so that I could do something like:
{exp:my_plugin file='{global_path}/css.js'}
And have {global_path}
be replaced with the value of global path?
Upvotes: 1
Views: 266
Reputation: 981
In your plugin, you can parse the parameter to match global variables:
$value = $this->_ee->TMPL->fetch_param('value', '');
$value = $this->_ee->TMPL->parse_globals($value);
You can find an example in https://github.com/pvledoux/Pvl_checkif/zipball/master
Upvotes: 6