P
P
Platton2016-03-05 20:12:29
PHP
Platton, 2016-03-05 20:12:29

php methods parameter identification?

Hello. There is a template engine skn . Briefly describe its work - it has compl methods (collects [% tag%] tags in the html template and assigns values ​​to them) and a load method that loads the html file into a string for further processing. This template engine suits me perfectly, but there was a need to identify compl methods .
For example, if we take one of the module classes of my cms, - Main. There are three compl methods here that need to be identified and somehow passed a third parameter identical to the name of the parameter from the load('main.tpl');
That is, it should be like this:
$this->skn->compl('[%info%]', 'INFORM', 'main.tpl');
$this->skn->compl('[%content%]', 'CONTENT', 'main.tpl');
$this->skn->compl('[%footer%]', 'FOOTER. 'main.tpl');
You can write this third parameter manually, but if there are dozens or more of such compl methods and 'main.tpl' needs to be constantly added and repeated, it's not right to wake up.
Question: How can compl methods be passed a third parameter identical to the name of the load('main.tpl') method parameter, which, in addition, is executed at the very end after all compl ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-03-05
@thewind

__CLASS__ or in your compl use get_called_class()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question