redirect,phalcon,phalcon-routing
The cause of redirection to "/index" was actually in the Permission class I made several weeks ago. It had: $this->response->redirect('index'); for every controller that guest could not access to. Since I added new controllers I was continuously redirected to index, and noticed that redirect comes from somewhere else when I...
Documentation says: /:int /([0-9]+) Matches an integer parameter Meaning it actually expects /:int, not just :int. Just use named params with custom regex? $router->add( '/album/view/{slug}-([0-9]+)', array( 'controller' => 'album', 'action' => 'view', 'id' => 1, // ([0-9]+) ) ); I didn't test this, but must be along those lines. ...
I've tested all possibilities given in the router documentation and even take a look in the router implementation for Phalcon 2.0 (are you using this version, right?!). The only thing that worked out was to not use named parameters at all, even the built-in placeholders needed to be removed from...
php,routing,phalcon,phalcon-routing
If you can convention that all country code comes first in the path, perhaps an additional rewrite rule can help you: <IfModule mod_rewrite.c> RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([a-z]{2})/(.*)$ index.php?_lang=$1&_url=/$2 [QSA,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L] </IfModule> EDIT If you really need to...
php,nginx,phalcon,phalcon-routing
The problem was in nginx config passing route in REQUEST_URI vs a special _url variable. To make Phalcon work with this setting I had to add $router->setUriSource(Router::URI_SOURCE_SERVER_REQUEST_URI); right after $router = new Router(); then it started working as it should :)...
angularjs,phalcon,phalcon-routing
In my routes I have a leading slash / //Define a route $router->add( "/userList", array( "controller" => "user", "action" => "get", ) ); and $http.get("/userList") That should work. However if you are creating a new project and don't need to support legacy urls, I would suggest just using the default...
The initialize function on a controller is an event ran after constructing the controller In order to display view for that controller it is necessary to at least setup an index action In your you are interested in rendering a route of /manager/ , this will correspond to indexAction class...