【问题标题】:Phalcon route groups 404 not workingPhalcon 路由组 404 不起作用
【发布时间】:2018-06-12 07:46:29
【问题描述】:

我有网址:

site.com/sdfsdfsdfsd - 404 工作

site.com/ru/page/sdfasdfasfasdfsad - 不工作,我被重定向到主页

$router->add('/', array(
  'module' => 'frontend',
  'controller' => 'index',
  'action' => 'index',
  'lang' => 'md',
))->setName('default');

$router->add('/{lang:[' . $langsDefined . ']{2}+}(/?)', array(
  'module' => 'frontend',
  'controller' => 'index',
  'action' => 'index',
  'lang' => 1,
))->setName('default_lang');

我该如何解决这个问题?

$router = new \Phalcon\Mvc\Router(false);
$router->notFound(array(
  "controller" => "Notfound",
  "action" => "index"
));

方法NotFound 不起作用。我被重定向到主页!

【问题讨论】:

    标签: php routes phalcon


    【解决方案1】:

    请注意命名空间,你可以这样尝试:

    $router->notFound(array(
        "module" => "frontend",
        "controller" => "Notfound",
        "action" => "index"
    ));
    

    【讨论】:

      猜你喜欢
      • 2021-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多