Not found class in Controller [closed]

0

The model only gives NOT FOUND in a controller that manages News.

  

ERROR: Fatal error: Class 'App \ Models \ Site \ NewsModel' not found in C: \ xampp \ htdocs \ ManagerContent \ App \ Controllers \ Site \ HomeController.php on line 13

Follow the link in pastebin to understand the problem: link

Model:

<?php

namespace App\Models\Site;

class NoticiaModel extends \ActiveRecord\Model {

    static $Table = 'noticia';
}

Controller:

<?php

namespace App\Controllers\Site;

use \App\Controllers\BaseController as Base;
use \App\Models\Site\NoticiaModel as Noticias;

class HomeController extends Base {

    public function index() {

        // List Noticias
        $Noticias = Noticias::all();
        dump($Noticias);

        $Dados = ['titulo' => 'Home'];
        $Template = $this->Twig->loadTemplate('Home.html');

        $Template->display($Dados);
    }
}
    
asked by anonymous 02.01.2016 / 21:28

1 answer

2

Solved the problem!

composer update

The problem is simply in the autoload of the directories Models that was pointing to another part of the project, causing no model created within the project to be recognized! :)

    
03.01.2016 / 07:17