Level 32
<link rel="stylesheet" type="text/css" href="public/css/style.css">
You can define helper like this
function asset($path)
{
return CONST_TO_PUBLIC_PATH.'$path';
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I follow the PHP Practitioner series and I have now a fully functional Router. The only thing I can't get my head around is how to load css files from the public folder.
Every time I try to load it it fails saying something along the lines of (Route not define, GET, css/files.css
Thanks
Eliott
<link rel="stylesheet" type="text/css" href="public/css/style.css">
You can define helper like this
function asset($path)
{
return CONST_TO_PUBLIC_PATH.'$path';
}
Please or to participate in this conversation.