I'm trying to create a class in EE, but for some reason it just won't work for me. I've even went as far as making it as easy as possible, but I always get:
The following tag has a syntax error:
{exp:my_class_name:testfunction}
Please correct the syntax in your template.
Here's the simple class:
class My_class_name {
public $return_data;
public function __construct(){
$this->EE =& get_instance();
}
public static function usage(){
ob_start();
?>
Coming Soon, this is just filler for now.
<?php
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
public function testfunction(){
$this->return_data = ee()->TMPL->tagdata;
}
}
and usage:
{exp:my_class_name:testfunction}
hey
{/exp:my_class_name:testfunction}