I started a new app using Phalcon 2, mostly by following the tutorial. I am using nginx set as here: https://phalcon-php-framework-documentation.readthedocs.org/en/latest/reference/nginx.html?highlight=nginx#nginx-installation-notes The router always loads the index controller and template.
$router = new Phalcon\Mvc\Router(false); $router->setUriSource(Phalcon\Mvc\Router::URI_SOURCE_SERVER_REQUEST_URI);
Also tested with the default $_GET['_url']
$router->add("/", array( 'controller' => 'index', 'action' => 'index' ));
Added the same route different ways (only one active, two commented out), even tried with double slashes or without any.
$router->add("/signup", array( 'controller' => 'signup', 'action' => 'index' ));
$router->add("/signup", 'Signup::index'); $router->addGet("/signup", 'Signup::index');
The debugging here shows string(7) "/signup" so I don't think it's an nginx problem.
var_dump($router->getRewriteUri());
This one is null.
var_dump($router->getMatchedRoute());
This one returns an array with two Phalcon\Mvc\Router\Route objects.
var_dump($router->getRoutes());
This one is also null.
var_dump($router->getControllerName ());
I have the signup template and controller, but it's only loading the index one.