I have been developing a project with php, but I am currently in a problem that is my php files of views have linked many css and js files, but as I am calling them from a router those relative paths are lost, I know that a solution It would be to place an absolute route, but it is not what I would like to see better the structure of my project.
Is there any way to create a method or a class that can make those css and js links to php views?
I'm organizing everything to mvc
I have a lot of css, js, img and fonts which I want to link, is there any libreria or something similar to be able to establish some order or how could I do that? I am currently running it on a local nginx server
.
├── app
│ ├── controllers
│ └── models
├── composer.json
├── composer.lock
├── public
│ ├── img
│ │ ├── awards-img
│ │ │ ├── a-1.png
│ │ │ ├── a-2.png
│ │ │ ├── a-3.png
│ │ │ ├── a-4.png
│ │ │ └── a-5.png
│ │ ├── bg-img
│ │ │ ├── about-1.jpg
│ │ │ ├── about-2.jpg
│ │ │ ├── hero-1.jpg
│ │ │ ├── hero-2.jpg
│ │ │ ├── hero-3.jpg
│ │ │ ├── hero-4.jpg
│ │ │ └── hero-5.jpg
│ │ ├── core-img
│ │ │ ├── about-dots.png
│ │ │ ├── point.png
│ │ │ ├── preload-1.png
│ │ │ ├── preload-2.png
│ │ │ ├── preload-3.png
│ │ │ └── special-dots.png
│ │ ├── icons
│ │ │ ├── cancel.svg
│ │ │ ├── email.svg
│ │ │ ├── left-arrow.svg
│ │ │ ├── phone.svg
│ │ │ ├── point.svg
│ │ │ ├── quotation-mark.svg
│ │ │ ├── right-arrow.svg
│ │ │ └── search.svg
│ │ ├── menu-img
│ │ │ ├── dish-1.png
│ │ │ ├── dish-2.png
│ │ │ └── dish-3.png
│ │ └── testimonial-img
│ │ ├── 1.jpg
│ │ ├── 2.jpg
│ │ └── 3.jpg
│ └── index.php
├── regular-page.html
├── resources
│ ├── assets
│ │ ├── css
│ │ │ ├── bootstrap
│ │ │ │ └── bootstrap.min.css
│ │ │ ├── others
│ │ │ │ ├── animate.css
│ │ │ │ ├── font-awesome.min.css
│ │ │ │ ├── magnific-popup.css
│ │ │ │ ├── owl.carousel.min.css
│ │ │ │ └── pe-icon-7-stroke.css
│ │ │ └── responsive
│ │ │ └── responsive.css
│ │ ├── fonts
│ │ │ ├── FontAwesome.otf
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.svg
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ ├── fontawesome-webfont.woff
│ │ │ ├── fontawesome-webfont.woff2
│ │ │ ├── Pe-icon-7-stroke.eot
│ │ │ ├── Pe-icon-7-stroke.svg
│ │ │ ├── Pe-icon-7-stroke.ttf
│ │ │ └── Pe-icon-7-stroke.woff
│ │ ├── js
│ │ │ ├── active.js
│ │ │ ├── bootstrap
│ │ │ │ ├── bootstrap.min.js
│ │ │ │ └── popper.min.js
│ │ │ ├── google-map
│ │ │ │ └── map-active.js
│ │ │ ├── jquery
│ │ │ │ └── jquery-2.2.4.min.js
│ │ │ └── others
│ │ │ └── plugins.js
│ │ └── style.css
│ └── views
│ ├── contact.php
│ ├── index.php
│ ├── layouts
│ └── menu.php
└── vendor