thecodeholic / php-mvc-framework

PHP MVC Framework
https://www.youtube.com/playlist?list=PLLQuc_7jk__Uk_QnJMPndbdKECcTEwTA1
470 stars 177 forks source link

Couldn`t figure out how to link to a local files/libraries (images, css, js) #11

Open Dr-help opened 3 years ago

Dr-help commented 3 years ago

Hello there,

thanks a lot for the the great course and the lovely educational materials. Im learning an experimenting with the framework and couldnt figure out how to modify the code to link to local js, css files instead of the online ones (JQuery, Bootstrap ..etc).

I tried all the tricks I know, with no avail. could you please help with that?

Dr-help commented 3 years ago

@thecodeholic could you kindly, suggest something to help!

RobertoVasquez01 commented 2 years ago

did you solve the problem?

thecodeholic commented 2 years ago

If you have a look at layout files - like this one you can see how it includes the local CSS file. Your CSS/JS or any static files must be inside public folder.

Please let me know if you find the answer.

RobertoVasquez01 commented 2 years ago

The framework is not the problem. The problem is the configuration of the .htaccess file.

thecodeholic commented 2 years ago

Try this one.

​RewriteEngine​ On ​RewriteCond​ ​%{REQUEST_FILENAME}​ ​!-f ​RewriteCond​ ​%{REQUEST_FILENAME}​ ​!-d ​RewriteRule​ ​.​ ​index.php