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.
This one is null.
This one returns an array with two Phalcon\Mvc\Router\Route objects.
This one is also null.
I have the signup template and controller, but it's only loading the index one.