jyncka
New member
I'm hoping someone can lend me a second set of eyes on this because I can't see what's wrong. I am trying to learn how to make callbacks for custom bbcodes and have this class:
And in my ACP I have set the custom code to "php callback" and then entered this in the class::method fields:
The class is installed in library/MyAddOn/BbCode/Image.php but when I try to save I get this: "Callback MyAddOn\BbCode\Image::img2 is invalid (error_invalid_class).".
Where am I going wrong?
PHP:
class MyAddOn_BbCode_Image {
public static function img2(array $tag, array $rendererStates, XenForo_BbCode_Formatter_Base $formatter)
{
$options = explode($tag, ',');
return "<img src=' . $tag["children"][0] . '" style='height: " . $options[0] . "px; width: " . $options[1] . "px;' >";
}
}
And in my ACP I have set the custom code to "php callback" and then entered this in the class::method fields:
Code:
MyAddOn\BbCode\Image::img2
Where am I going wrong?