Código PHP:
<?php
class FrontController{
static function main(){
//Incluimos algunas clases:
require 'libs/Config.php'; //de configuracion
require 'libs/SPDO.php'; //PDO con singleton
require 'libs/View.php'; //Mini motor de plantillas
require 'libs/ControllerBase.php'; //ControllerBase
require 'libs/ModelBase.php'; //ModelBase
....
Código PHP:
class IndexController extends ControllerBase {
function __construct() {
}
public function index(){
$this->view->show("index.php");
}
}
Código PHP:
abstract class ControllerBase {
protected $view;
function __construct(){
$this->view = new View();
}
}
Fatal error: Call to a member function show() on a non-object in C:\wamp\www\HumbertoDiaz\Controllers\IndexControll er.php on line 7
Que es cuando intento llamarlo, pero si intentara hacer esto:
Código PHP:
class IndexController{
function __construct() {
}
public function index(){
$this->view = new View();
$this->view->show("index.php");
}
}
Saludos.