I have read the docs regarding three segments and tag pairs.
I want to make use of both like so:
class Myutils {
var $return_data;
function cleanstring()
{
global $TMPL, $FNS;
$str = $TMPL->tagdata;
$str = strtoupper($str);
$this->return_data = $str;
}
function usage()
{
ob_start();
?>
TBC
<?php
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
/* END */
}
// END CLASS
?>
As i go on, i want to add functions to this plugin for personal use. Problem is that when i use it, i can echo the returned uppercase string, but it doesnt get returned to the calling template. The calling template returns nothing,
{exp:myutils:cleanstring}my lower case string{/exp:myutils:cleanstring}
Am i doing something wrong?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.