You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This doesn't work for me (PHP doesn't like it - referencing $this in a non-object context), and I can't find anything in the documentation about calling a class instance method in a helper.
The text was updated successfully, but these errors were encountered:
This doesn't work, since the Handlebars template and helpers are compiled to separate functions which aren't inside your class. So the helper function would need to construct a new instance of the class before calling a method on it.
The PHP Code:
protected function makeSomeText()
{
$php = LightnCandy\LightnCandy::compile($html, array(
'helpers' => array(
"flags": LightnCandy\LightnCandy::FLAG_HANDLEBARS,
"story"=>function($identifier, $options)
{
return $this->getTextForResponse($identifier);
}
)
)
);
}
The Issue:
This doesn't work for me (PHP doesn't like it - referencing $this in a non-object context), and I can't find anything in the documentation about calling a class instance method in a helper.
The text was updated successfully, but these errors were encountered: