0
The model only gives NOT FOUND in a controller that manages News.
ERROR: Fatal error: Class 'App Models Site Noticiamodel' not found in C: xampp htdocs Managercontent App Controllers Site Homecontroller.php on line 13
Follow link in Pastebin to understand the problem: http://pastebin.com/HkPjXL0j
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);
}
}
This framework was created by you?
– rray
It was. It’s a standard base structure I created, where I only create the controllers I need.
– jonniehenrique
This looks like Laravel combined with http://twig.sensiolabs.org, that’s it?
– Guilherme Nascimento
Exactly, Guilherme. Within the project, via Commodore I call Twig and the helpers of Laravel. :)
– jonniehenrique
But I don’t understand why the News Model from not found in the Home controller, to list news. I’ve reviewed the paths and everything is okay. :(
– jonniehenrique
So your statement to @rray is wrong jonniehenrique, he asked if the framework was you who created it, but this is wrong, in fact you created the application that uses an existing framework called Laravel. Please next time post the information clearly as this complicates the understanding ;)
– Guilherme Nascimento
I posted clearly, William. I spoke q created a base structure using Laravel helpers. The total structure is independent of any framework. :)
– jonniehenrique