Jump to content

Framework problem


Nedyc

Recommended Posts

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...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...