using a Tag to output content directly

8 views
Skip to first unread message

Chuck Trukk

unread,
Nov 17, 2009, 2:20:36 PM11/17/09
to H2o template PHP
I am using this in the modx cms. Thought I'd share a tip.

Sometimes I want the Tag to output the content directly.

To do this, you can:

function render($context, $stream) {
$method = str_replace(":", '', $this->args[0]['api']);
$var = str_replace(":", '', $this->args[0]['name']);
$output = $this->modx->$method($var);
$context->set('test', $output);
$stream->write($output);
}
Reply all
Reply to author
Forward
0 new messages