Content last modified Tuesday 24 August 2021
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:
30 Mar 2005

You know you want to visit the Archives.
Published with Textpattern