Answer the question
In order to leave comments, you need to log in
How to associate a file with a class?
In a separate file, MyClass.php, there is a class with two methods:
<?php
class MyClass {
public function render() {
require template.php
}
public function method1() {
//some code here
}
}
<?php
$this->method1();
Answer the question
In order to leave comments, you need to log in
As an option in template.php after the opening php tag add the ward /** var $this MyClass */
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question