<txp:php /> container tag, 0 attributes

php

The php tag is a container tag that is the textpattern equivalent of:

<?php //Code goes here... ?>. 

Use it like this:

<txp:php>
  // Code goes here...
</txp:php>

Control over where this tag is allowed to appear (i.e. the privileges required to allow it to appear in pages and forms) are governed by settings in the Advanced Preferences tab.

<txp:php /> 2 examples

Display PHP server library information

<txp:php>
    phpinfo();
</txp:php>

Show the current linked category title

<txp:php>
  echo "The current TXP category is: "
    . category(array(
        'title' => '1',
        'link' => '1',
        'wraptag' => 'div'
      ));
</txp:php>

Note that all TXP tags have an equivalent programmatic name which is exactly the same as its tag name. e.g. <txp:recent_articles /> is recent_articles().

Also note that you must pass an array to all tag functions, even if there are no attributes to set. For tags that require no attributes or those that you do not wish to modify the defaults, pass an empty array, viz: category1(array());

Other tags used: category