beautiful/view — Issue #3: Late static binding in Template ?
Author: ccazette
Created: 2011-12-28 14:54:02+00:00
State: open

I am a bit confused here as I don't get how the code can work as presently written...

In Template Class, the path() method is supposed (I guess) to use Template_Mustache or Template_PHP static $ext or $dir to generate the path. You can't access Template_Mustache::$ext from Template using self as this is presently the case : http://php.net/manual/fr/language.oop5.late-static-bindings.php

The only options I see are to use static::$ext and static::$dir or to make these properties non-static since path runs in the object context anyway...

As written now, I can't load any Mustache template since the extension self::$ext is always equal to NULL, as defined in Template.