pug-php / pug

Pug template engine for PHP
https://www.phug-lang.com
MIT License
391 stars 42 forks source link

php static function call from class #116

Closed ivitaly closed 7 years ago

ivitaly commented 7 years ago

Seems there some problems around static classes and maybe namespaces

// php file

class Util {
    static function Function() {
          return "sample";
    }
}

// pug file

section#my
      =Util::Function()
kylekatarnls commented 7 years ago

I tried the following static call on http://pug-demo.herokuapp.com/:

section
  =DateTime::createFromFormat('j-M-Y', '15-Feb-2009')->format('Y-m-d')

And I get:

<section>
  2009-02-15 
</section>

This is the expected behaviour.

I also tested creating a class and static method locaaly and it works well too.

To get a faster help, please follow the pattern given in the guidelines:

Issue pattern

It must at least include your code, the result you get and the result you expect.

Thanks,