I am learning MVC in PHP. The css and js files are not working in php pages.
I am using eclipse, xampp server.
This is my .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME)} !-d
RewriteCond %{REQUEST_FILENAME)} !-f
RewriteCond %{REQUEST_FILENAME)} !-l
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
this is my bootstap.php
<?php
class Bootstap {
function __construct() {
$url = isset($_GET ['url'])?$_GET ['url']:null;
$url = rtrim($url,'/');
$url = explode ( '/', $url );
// print_r ( $url );
if (empty($url[0])){
require 'controllers/Index.php';
$controller = new Index();
return false;
}
$file = 'controllers/' . $url [0] . '.php';
//print_r ( $file );
if (! file_exists ( $file )) {
require 'controllers/Error.php';
$controller = new Error ();
return false;
}
require "$file";
$controller = new $url [0] ();
if (isset ( $url [1] )) {
if (isset ( $url [2] ))
$controller->$url [1] ( $url [2] );
else
$controller->$url [1] ();
}
}
}
How do I resolve this issue?