Hi, I am developing custom MVC application, in View folder i placed multiple templates, to access html asset(css and images), i have to write actual path every time (e.g. <?php $baseurl;./logo.jpg), plz let us know how can get path relative path in view/templatename folder.
you should put your assets (js, css and images) in the web root directory.. so you can access them freely like /js/myjavascriptfile.js, /css/stylessheet.css or /images/logo.jpg
I wouldn't use the relative path, or the root (since the root assumes the script will always be running from the root path). Far better to set a constant with the path and preceed all your images, css, js etc. Then it can be easily re-configured if need be.