Updating to Phalcon 4: App->handle() URL problem #15510
-
I'm updating my app from using 3.4 to 4.12. One of the changes is that \Phalcon\Mvc\Application::handle() now requires a URL be passed. The documentation shows only passing However, my application is not running at the server root. So for the URL: I'm setting the URL service to have a baseURI of To be clear, this app was working fine on 3.4. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Nothing like a lunch break to clear the head. The answer was to modify the URL being passed, to trim off the part of the URI that refers to the subdirectory. So now I have: $rooted_uri = substr($_SERVER["REQUEST_URI"],strlen($Config->dirs->web));
echo $App->handle($rooted_uri)->getContent(); With |
Beta Was this translation helpful? Give feedback.
Nothing like a lunch break to clear the head.
The answer was to modify the URL being passed, to trim off the part of the URI that refers to the subdirectory. So now I have:
With
$Config->dirs->web
being "/appname", the URI passed to$App->handle()
becomes just/
, and the routing & dispatching looks like its working.