On Tue, Nov 13, 2012 at 9:21 AM, Vanja Dizdarević
<[email protected]> wrote:
> I have an 2.1.1 app under a sub-path (example.com/app-name/).
>
> I am doing a redirect like this:
>
> $url = Router::url(array('controller' => 'user', 'action' => 'view', 5));
> //yields "/app-name/user/view/5"
> $this->redirect($url);
>
> Redirects to '/app-name/app-name/user/view/5'. Essentially double-basing the
> url.
>
> How can I:
>
> A: Redirect to the direct url without using server name?
> B: Get the app-relative path (/user/view/5)
>
> Keep in mind that $url value is passed around and cannot be passed to the
> $this->redirect as an array.
What happens if you do feed the array to redirect()? Like if you
hard-code it there as a test. If that works, you could always
serialize the array if it must be "passed around" as a string.
I've never done anything with sub-paths, etc. so I don't know what to
suggest otherwise.
> I have also tried Router::parse('/app-name/user/view/5'); which gives me
> controller=> 'app-name', etc...
>
> Thanks!
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.