Answer the question
In order to leave comments, you need to log in
How to create a helper using Laravel as an example?
Hello. Help create view, db helpers like in Laravel. Now I just declared a global function
function view($template) {
return new View($template);
}
Answer the question
In order to leave comments, you need to log in
Judging by the description, you do not need to write a helper, but create some kind of service.
In Laravel, for example, they write ServiceProvider for this.
If we talk specifically about the view, then you need to define the composer
Create app/helpers.php, register it in autoload in composer, make the necessary functions in it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question