antonellopellecchia / uri_mail

A Textpattern plugin to let users send messages to the administrator
0 stars 4 forks source link

$form should be parsed #2

Closed gocom closed 10 years ago

gocom commented 10 years ago

Since the $form contains a template tag, it needs to be passed through parse() function. E.g.

return parse($form);

The plugin is currently working just because of the second pass we do with the parser, but this isn't meant as a replacement for parsing; its used for callbacks and pushing data to prior nodes in the template. Leaving parser out cuts the parser queue, and the plugin may not work in every given context.

ghost commented 10 years ago

Sorry, I didn't understand. What's wrong in $form? And what's the parser() function (I could'n find it in the PHP documentation)?

gocom commented 10 years ago

Oh, sorry, not parser, but parse -- it's part of Textpattern.

ghost commented 10 years ago

Really, I couldn't find it in the Textpattern documentation. Could you please give me a link where I can find some help?

gocom commented 10 years ago

See the PHPdoc signature in the source. There not much to the function other than to the copy+paste snippet I gave:

return parse($form);

The function parses template tags in the given string argument and returns the parsed string.

ejntoo commented 10 years ago

Finally done! Sorry for keeping you waiting (lack of time)!