Here is my question for today. I create (for fun) a simple template engine. The basic idea is that I have a tag like this {blog: content}, and I break it down in method and action. The problem is that when I want to dynamically call a static variable, I get the following error.
Parse error: parse error, expecting `','' or `';''
And the code:
$class = 'Blog';
$action = 'content';
echo $class::$template[$action];
$ template is a public static variable (array) inside my class and is the one I want to get.
source
share