Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
txp:yield and txp:php are not friends
I have the following code in a form
<!-- '<txp:yield />' -->
<txp:php>
print( '<!-- <txp:yield /> -->' ) ;
</txp:php>
The resulting output when called with “tools” as the form content is
<!-- 'tools' -->
<!-- -->
So, txp:yield is not working inside txp:php. How do I fix this?
Offline
Re: txp:yield and txp:php are not friends
Try:
<!-- '<txp:yield />' -->
<txp:php>
echo parse('<!-- <txp:yield /> -->');
</txp:php>
In php you can either call the function name directly or you have to run it through parse ('…');
. The case of yield is a special one because that function name already exists in php.
TXP Builders – finely-crafted code, design and txp
Offline
Re: txp:yield and txp:php are not friends
Adding parse() makes everything work beautifully. Thank you!
Offline
Pages: 1