简体   繁体   中英

phalcon router not despatching

I have this in the top of my index.php:

<?php
use Phalcon\Loader;
use Phalcon\Di\FactoryDefault;
use Phalcon\Mvc\View;
use Phalcon\Mvc\Application;
use Phalcon\Mvc\Url as UrlProvider;
use Phalcon\Db\Adapter\Pdo\Mysql as DbAdapter;
use Phalcon\Mvc\Router;

define('BASE_PATH', dirname(__DIR__));
define('APP_PATH', BASE_PATH . '/app');

/*
if (isset($_GET['_url'])) {
        var_dump($_SERVER["REQUEST_URI"]);
        var_dump($_GET['_url']);
        die();
}
*/

// Create the router
$router = new Router();

// Define a route
$router->add(
    '/signup',
    [
        'controller' => 'signup',
        'action'     => 'index',
    ]
);
$router->handle(
    $_SERVER["REQUEST_URI"]
);

no matter what I do, any attempt to access /signup just takes me to index/index. You will notice the isset check - that is reporting that the correct parameter ( /signup ) is being passed, but the routing isn't happening. Note the explicit route for testing. With or without that the routing doesn't happen.

Any idea what's happening? Thanks.

发现它,行中有一个随机的1

$response = $application->handle();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM