i have folders like this
\htdocs\router\index.php -> main index file
\htdocs\router\view\ -> all html and php files
\htdocs\router\view\asset -> all css, js , etc files
\htdocs\router\controller\App\main.php -> controller file
Now when someone point to http://localhost, the index.php create new object (new main() ) from main.php (class main) and executes index function (public function index() { ... }) . This function have does an include like this ( require 'view/login.php'; ).
I can see the output of login.php but all .css, .jpg, .js files wont load because they are declared in login.php like this :
<link rel="stylesheed" href="asset/style.css" type="text/css">
because the asset/ directory is located where login.php file is.
if i put href="view/asset/style.css" it's working .
The question is :
How can i include a .php file from other folder to make it work without chaning the href tag and without moving the asset folder up.
assetfolder andlogin.phpare both inviewdirectory