【问题标题】:Php routing always contains Pagesphp 路由总是包含 Pages
【发布时间】:2017-04-21 00:05:23
【问题描述】:

每次我尝试引用文件或任何内容时,/Pages/ 总是位于 URL 的开头。所以我收到这些错误,需要将所有按钮链接更改为 ../

我的 routes.php 文件就是这样

Router::scope('/', function (RouteBuilder $routes) {


    $routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);

    $routes->connect('Pages/*', ['controller' => 'Pages', 'action' => 'display']);

我在 codeanywhere 中使用 cakephp(不要问)。

【问题讨论】:

    标签: php cakephp routing


    【解决方案1】:

    试试:

     $routes->connect('/Pages/*', ['controller' => 'Pages', 'action' => 'display']);
    

    【讨论】:

      猜你喜欢
      • 2020-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-05
      • 2018-01-11
      • 1970-01-01
      • 2011-02-15
      相关资源
      最近更新 更多