3
I have the following structure:
I would like the file, inside views/usuarios/usuarios-view.php
, include the file _layout.html
who stands in the way: views/_template/_layout.html
, I’m doing so in the usuarios-view.php
:
<?php include ("../_template/_layout.html"); ?>
Meanwhile he takes the path:
http://localhost/Medic/views/users/_template/dist/lib/css/bootstrap.min.css
When I should be on my way:
http://localhost/Medic/views/_template/dist/lib/css/bootstrap.min.css
How can I fix this?
Use the absolute path, or http://www.w3schools.com/tags/tag_base.asp
– mau humor
@user5978 the bad thing is that if use like this, when playing for the server I will have to change the way there too.
– Bia
I see no other solution to this, because what generates the "problem" is the behavior of the browser, and not of your system, so it is "out of your reach".
– mau humor
<?php include ("../../_template/_layout.html"); ?>
– user3603
The best way is how @mauhumor spoke using the base tag. But you can popular it using the php $_SERVER global variable, using the SERVER_NAME and REQUEST_URI values
– Willian