igaster / laravel-theme

Theme support for Laravel
MIT License
520 stars 113 forks source link

The url function doesn't care about possible base_url config #82

Closed etshy closed 5 years ago

etshy commented 6 years ago

I'm working on a dev server, so I use subfoder in www/html folder to test my apps. So my laravel app are in /var/www/html/laravel_app and I acces by http://myserverip/laravel_app/

As the theme class > url function don't take the base_url (config set in both app.php config file) it try to load /content/themes/... instead of /laravel_app/content/themes/...

classic url() function in Laravel works great with my subfolder, only files not loaded are from the themes folder.

igaster commented 6 years ago

That is a tricky config.

Your problem lies with theme views or with theme assets?

etshy commented 6 years ago

It was with theme assets when I called Theme::url() in my layout it doesn't return the host/subfolder, only the them path, starting with '/content/theme' etc.

kavin-90 commented 6 years ago

same here

theme_url return /css/style,css that i wrote in theme_url("/css/style,css") function :(

igaster commented 5 years ago

The problem is that the package will return the relative URL to document root, because defining the url parameter at the app.php configuration file is optional.

You may wrap it with laravel url() function to get the full URL:

url(theme_url('file1.txt'));