Closed diosney closed 10 years ago
I'm not sure if this is the only compatibility issue with php 5.2 because we wrote it with php 5.3+ in our minds. but I would be happy to see php 5.2 support, so patches are welcome.
anyways, this one can be fixed easily. just make helpers ( https://github.com/XaminProject/handlebars.php/blob/8eb732f407121392015b1bcf032f8e4287fb3969/src/Handlebars/Helpers.php#L67 ) static and register 'em like: $this->add('if, array('Handlebars_Helpers', '_if'))
.
for example if
helper (defined in line 71), should be like:
public static function _f($template, $context, $args, $source) {
// body is the same
}
Yeah!!!! Thanks!!!! It worked like a charm!!!
I will push this changes to make at least the helpers compatible with 5.2 :D
Until now I didn't found any other issues, if I found another one I will report it or try to fix it.
You rock!
thanks @diosney.
I know PHP 5.2 is a bit old but is the version that some hosting providers (like HostGator) have installed so it cann't be left forgotten.
This code is working ok in PHP 5.4 but for some reason in a PHP 5.2 installation it throws the following error:
<b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/.../Handlebars/Helpers.php</b> on line <b>71</b><br />
My Handlebars template is has follows:
It could be great if you can help me on this.
Thanks