getStatic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey guys,

So, I was working on my framework today, and noticed unfortunately that PHP does not allow using the magic method __get for static variables. There is a patch available, but I'm not sure how long it will be before it makes it into the stable PHP release.

Anyway, my question is about what route I should take now.

The reason I was looking for this was for the built in template engine. I expected to be able to put in a page

{HTML::$variable1}
or
{self::$variable1}

and have it evaluate using native PHP variables, instead of doing a large number of PHP str_replace for text based variables, a process which is surely slower.

As I see it, my options are:

Create

public static function get($fpName)

And have my templates littered with the extra

{HTML::get(variable1)}

OR

use PHP str_replace based variable parsing creating what I imagine would be a significantly higher overhead.

What would you do?

- Craige



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux