Trying to deal with this php framework: https://github.com/daveh/php-mvc Twig is used there. The first time I come across it.
The User model has a getAll method (fetching all users).
In the home page controller (Home) there is an indexAction method, which returns the view (view) View::renderTemplate('Home/index.html');
The most important question: So how do I now display a list of all users in the view?
I can not write php code in index.html (can not be changed to .php, gives an error).
I found out that you can pass variables when creating a view:
View::render('Home/index.php', [ 'name' => 'Dave' ]); But it did not help much. Instead of Dave, I need a method from the model that will return me a list of all users.
I would be extremely grateful for the help!