I create my mini-micro framework. In my class which loads template I have property named $variable. This property stores array of viariables which should be available in my template.

For example:

$this->variable = array($key=>5, $data=>10);

Next, I use function extract()

extract($this->variable);

So, now in my template(test.html.php) I have simple access to passed variables:

test.html.php

echo $key;

I also have method named import(). In my template I have access for this method by operator $this

test.html.php

$this->import();

Is there any possibility to call my function import() in template, without operator $this?

Related posts

Recent Viewed