简体   繁体   English

phalcon路由器没有派遣

[英]phalcon router not despatching

I have this in the top of my index.php: 我在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. 您将注意到isset检查 - 即报告正在传递正确的参数( /signup ),但路由没有发生。 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();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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