I am running symfony on my localhost for learn, i have configured my localhost folder http://localhost/symfony to http:/symfonyweb.
Everything works fine but style can't loading,
<link rel="stylesheet" type="text/css" href="/assets/css/style.css">
full url is: http://symfonyweb/assets/css/style.css
Your asset should be load using the function asset()
which is linked to /web
root directory.
In your case, your assets should be like <link rel="stylesheet" type="text/css" href="{{ asset('assets/css/style.css') }}">
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.