Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-02-17 16:57:35

aniv
New Member
Registered: 2007-02-17
Posts: 2

Using txp tag output as PHP variable

Hello,

I’m new to this forum and new to Textpattern, so my apologies in advance if this is a silly question.
I need a way to capture the output of a certain txp tag (in this case <txp:ign_user_field> from the ign_password_protect plugin) in a PHP variable for further processing. Is there a way to do that? Perhaps a PHP API to access <txp:…> tags?

Thanks,
Ani

Offline

#2 2007-02-17 17:35:16

aniv
New Member
Registered: 2007-02-17
Posts: 2

Re: Using txp tag output as PHP variable

I just solved my specific problem – there is a cookie that I can read from that stores the data I need.
Still, if there are some sort of PHP hooks to capture the output of, say, <txp:form_output> or any other sort of tag, it would be nice to know.

Offline

#3 2007-02-17 18:19:47

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Using txp tag output as PHP variable

Generic example (where ‘txptag’ is a textpattern tag like ‘form_output’):

<txp:php>
  $var = txptag(array('attrib1' => 'value', 'attrib2' => 'value', etc.));
</txp:php>

and for container tags where $thing is the string that is contained:

<txp:php>
  $var = txptag(array('attrib1' => 'value', 'attrib2' => 'value', etc.), $thing);
</txp:php>

Last edited by ruud (2007-02-17 18:22:34)

Offline

Board footer

Powered by FluxBB