I've got one plug-in which provides a dynamic tag and we're developing *another* plug-in with another dynamic tag. We'd like to use this second tag as an argument to the first, but are running into trouble.
#TAG1 takes some parameters and feeds them to a template after some processing and #TAG2 looks up 'afieldname' in the database and returns the correct value.
#TAG2 works fine when used normally in a SPIP template, but when we pass it as an argument to #TAG1 like so:
[(#TAG1{'afield', [(#TAG2{'afieldname'})]})]
#TAG1 outputs the generated PHP code which calls balise_TAG2_dyn() instead of the value. Do I need to modify my implementation of #TAG1 to evaluate its parameters before using them? Or is there something else at work here?
#TAG1 outputs the generated PHP code which calls balise_TAG2_dyn() instead
of the value. Do I need to modify my implementation of #TAG1 to evaluate its
parameters before using them? Or is there something else at work here?
As ou have understood the "result" of a dynamic tag is php code that
will be eval()'d at the last moment.
You can probably do #TAG1{xxx, #INCLUDE{small squelette containing #TAG2} }, because #INCLUDE forces evaluation.
#TAG1 outputs the generated PHP code which calls balise_TAG2_dyn() instead
of the value. Do I need to modify my implementation of #TAG1 to evaluate its
parameters before using them? Or is there something else at work here?
As ou have understood the "result" of a dynamic tag is php code that
will be eval()'d at the last moment.
You can probably do #TAG1{xxx, #INCLUDE{small squelette containing #TAG2} }, because #INCLUDE forces evaluation.
Alas, it outputs the code of the #INCLUDE{}ed template instead. I'm going backwards!