HomeController.php 380 B

12345678910111213141516171819202122
  1. <?php
  2. namespace App\Controllers;
  3. use App\Models\HomeModel;
  4. use App\Controller;
  5. use App\Model;
  6. class HomeController extends Controller {
  7. public function __construct($twig)
  8. {
  9. $this->twig = $twig;
  10. $this->model = new HomeModel;
  11. }
  12. public function index(){
  13. echo $this->twig->render('home.twig', array(
  14. "messages" => $this->model->getMessages(),
  15. ));
  16. }
  17. }