Sujet : Suite MVC
Salut,
Dans mon index.php, je note ceci (honteusement pompé sur ton exemple)
require dirname(dirname(__DIR__)) .
DIRECTORY_SEPARATOR . 'Data' .
DIRECTORY_SEPARATOR . 'Core.link.php';
from('Hoathis')
->import('Maitrepylos.Debug');
from('Hoa')
-> import('Router.Http')
-> import('Dispatcher.Basic')
-> import('File.Read')
-> import('Http.Response')
-> import('Xyl.~')
-> import('Xyl.Interpreter.Html.~')
-> import('Database.Dal');
$router = new Hoa\Router\Http();
$router->get('g', '/(?<all>.*)', 'index', 'default');
$dispatcher = new Hoa\Dispatcher\Basic();
$dispatcher->dispatch(
$router,
new Hoa\Xyl(
new Hoa\File\Read('hoa://Application/Views/Main.xyl'),
new Hoa\Http\Response(),
new Hoa\Xyl\Interpreter\Html(),
$router
)
);et dans Hoa://application/controller/inde.php je note ceci
<?php
class index extends \Hoa\Dispatcher\Kit {
function defaultAction() {
$this->view->addOverlay('hoa://Application/Views/tuto/Index.xyl');
$this->view->render();
return;
}
//put your code here
}J'obtient l'erreur suivante
Fatal error: Cannot redeclare class index in /opt/www/testHoa/Application/Controller/Index.php on line 0 Auriez-vous une piste ?