0

Is it possible to use tag pairs as parameters?

Take the code below

{exp:utilities:foo}
    {qux}abcdef{/qux}
    {lux}12345789{/lux}
{/exp:utilities:foo}

Normally, using parameters, you are going to do this

$qux    = ee()->TMPL->fetch_param('qux');

Inside the plugin, is there something I can call to get the values between the tag pairs just like the code above?

My motivation for doing this is because using "parameters" for plugins usually result in a parse order issue for me.Some people seem to have the same problem too.

NOTE:

I aiming to use the parameters to do some processing and return a single string for the plugin.

0

1 Answer 1

1

you'll have to fetch / process them from tagdata yourself.
$this->EE->TMPL->var_pair will have an array of var-pairs you can walk.
Then compare / preg_match() them on the keys/tags you're looking for.

You can see by looking at an example in a small calendar class i made:
Calender_entries (github, highlighted)

1
  • Nice! I could peruse the regular expression to parse what is inside the tags. Commented Dec 29, 2013 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.