Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.1
About It:
Get it:
Rate it:
  • Helpful?
  • 1 Yes
  • 2 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

zem_php

<txp:zem_php> offers an alternative to <?php ?> for executing PHP code.

Features:

  • Executes code in context, so things like $thisarticle work as expected
  • Code execution can be controlled by disabling the plugin, rather than editing $txpac
  • Textpattern tags in the PHP output will be parsed, enabling things like this:

<txp:zem_php>
if ($foo) {
echo "<txp:excerpt />";
}
else {
echo "<txp:body />";
}
</txp:zem_php>

To use, just surround your PHP code in <txp:zem_php> </txp:zem_php> tags. It will work fine in a form or page template.

This probably behaves strangely in some curcumstances, due to the way Textpatten parsing works, so I wouldn’t recommend it for production code. Might be useful for experimenting though.

Article Request Count:
Initially released:
2004-10-19
Posted here:
29 Mar 2005
Article modified:
04 Oct 2005

You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern