Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elixir PHP function returns wrong absolute path #7304

Closed
eusonlito opened this issue Feb 6, 2015 · 4 comments
Closed

Elixir PHP function returns wrong absolute path #7304

eusonlito opened this issue Feb 6, 2015 · 4 comments

Comments

@eusonlito
Copy link
Contributor

My environment route is http://localhost/example.com/www/public/ and my code

<link rel="stylesheet" href="{{ elixir("css/app.min.css") }}">

But elixir function returns

<link rel="stylesheet" href="/build/css/app.min-ea7ebc07.css">

instead of absolute path

<link rel="stylesheet" href="http://localhost/example.com/www/public/build/css/app.min-ea7ebc07.css">

The documentation says something like

<link rel="stylesheet" href="{{ elixir("css/all.css") }}">

It's a but or I need to use some extrange hack like

<link rel="stylesheet" href="{{ url(elixir("css/app.min.css")) }}">

Best regards.

@GrahamCampbell
Copy link
Member

You need to set app.url in your config correctly.

@eusonlito
Copy link
Contributor Author

Why asset() and url() work from one way (absolute full path with host) and elixir() works as different way (relative to basepath)? Thanks :)

@DenisAlliswell
Copy link

@eusonlito just use it like that if you need to push absolute pathes:

<link href="{{ asset(elixir('css/all.css')) }}" rel="stylesheet" type="text/css">
<script src="{{ asset(elixir('js/all.js')) }}" type="text/javascript"></script>

@llioor
Copy link

llioor commented Jan 12, 2017

@GrahamCampbell the app.url is correct.
The problem is when you have VH with wamp and the base path "/" go to you www folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants