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
Without url encode in generate #58
Comments
|
That's an interesting issue. I assume it's because the value itself includes slashes (e.g., "path" => "/css/something.css"). The question then is, does it cause trouble later on, or does it just look ugly? |
|
The url will be |
/me nods Alternatively, do we want to change %2F back to / when doing url encode in the router? I don't know if that's a good idea or not. |
|
The problem is <link rel="stylesheet" href="<?php echo $this->router()
->generate('aura.asset',
array(
'vendor' => 'cocoframework',
'package' => 'example',
'file' => '/css/poole.css'
)
); ?>">
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /asset/cocoframework/example//css/poole.css was not found on this server.</p>
<hr>
<address>Apache/2.2.22 (Ubuntu) Server at cocoframework.localhost Port 80</address>
</body></html>
I don't know what you were looking for :( . Taking the route from https://github.com/harikt/Aura.Asset_Bundle/blob/master/config/Common.php#L28-L34 $router->add('aura.asset', '/asset/{vendor}/{package}/{file}')
->setValues([
'action' => 'aura.asset',
])
->addTokens(array(
'file' => '(.*)'
)); |
|
Yeah, so what I'm saying is that maybe we should ...
... then replace the token with that value. The idea is that we url encode everything except slashes. (An alternative would be to explode the value on slashes, url encode each piece, then implode with slashes.) Does that make sense? |
|
Got it. Not sure whether it is right / wrong. But it will work I guess :) . |
|
Hey, can you send me the route code you are using to point to the asset bundle? I want to try some stuff out. |
|
@pmjones yes. That is the route code. Nothing more. |
|
OK, @harikt , check out the new genraw branch. The generate() method now takes an optional third param, an array of keys to be left raw. https://github.com/auraphp/Aura.Router/blob/genraw/src/Generator.php#L44-L58 So you could call It's kind of hackish, so I'm open to other ideas. |
|
Closed per the new generateRaw() method. Thanks @harikt for talking this out with me. |
Is it possible to create urls without urlencode ?
Eg : in aura/asset-bundle when we pass the file path as
/css/something.cssall will be converted to %2Fcss%2Fsomething.css . That means even when we have the real path with some sort of file moved, the css may not get loaded.Any idea to fix for routes like that ?
The text was updated successfully, but these errors were encountered: