Well, I've studied the php 6 tutorial on killerphp.com so I've an index like this
<body>
<?PHP
include('dbconfig.php');
//AUTOCARICAMENTO CLASSI//
define("APPLICATION_PATH",realpath("../"));
$paths = array(
APPLICATION_PATH,
get_include_path()
);
set_include_path(implode(PATH_SEPARATOR,$paths));
function __autoload($className){ //Se richiamo una classe e non la trovo
$fileName = str_replace("\\","/",$className).'.php';
require_once $fileName;
return;
}
//--AUTOCARICAMENTO CLASSI--//
use \com\andorigo as path;
$dbConn = new path\models\dbConnection($dbHost,$dbUsername,$dbPassword,$dbName);
//CONTROLLERS//
$uri = strtolower($_SERVER['REQUEST_URI']);
//Se sono offline
if(strpos($uri,"/public/")){
$uri = str_replace("/demo/ocarine/","",$uri);
}
//
list($pfx,$controllerName,$actionName) = preg_split("/[\/\\\]/",$uri);
switch($controllerName){
case "":
case "index":
$controllerName = "index";
$controller = new path\controllers\indexController($controllerName,$actionName);
break;
case "admin":
$user = new path\models\user();
$controller = new path\controllers\adminController($controllerName,$actionName);
break;
}
$controller->dispatch();
//--CONTROLLERS--//
?>
</body>
I also have the 'view' pages and their controllers, but when I try to do a script src or link a css stylesheet it won't work in any page...