【问题标题】:Laravel 5 HMVC routes issueLaravel 5 HMVC 路由问题
【发布时间】:2016-10-21 15:58:52
【问题描述】:
  ->app
     ->assets
     -> Commands 
     -> Console
     -> Events
     -> Exceptions
     -> Handlers
     -> Helpers
     -> Http
     -> Libraries
     -> Models
     -> Modules
     -> Providers
     -> Services

请查看我的应用程序的文件夹结构。您可以看到模块位于 App 文件夹中。现在查看 Modules 文件夹结构。 ->模块 ->ABC ->定义 ->吉 ->jkl

当我点击 url localhost/abc/123/xyz 时,它通常应该转到 http 文件夹并搜索 123 控制器和函数 xyz(),但它会转到 Modules 文件夹并查找模块 123 和控制器 xyz。

    There is no .htaccess file and i don't know why this is happening to me.
    why this is happening and what is could the reason behind this?

这是一个 HMVC,而不是传统的 laravel 应用程序,但这件事让我发疯了。如果您已经过期,请帮助我。

【问题讨论】:

    标签: laravel


    【解决方案1】:

    localhost 没有映射到 laravel 中的文件夹结构。它映射到 public/ 文件夹。 public 文件夹中的 index.php 正在启动 l5 生命周期。

    路由在 routes.php 中定义。控制器可以无处不在,但您必须满足 psr-namespacing 才能自动加载。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-06
      • 2014-09-11
      • 2016-05-14
      • 1970-01-01
      • 2014-08-14
      • 2018-11-20
      相关资源
      最近更新 更多