【问题标题】:Kohana 3.2 Route - controllers in subdirectoriesKohana 3.2 Route - 子目录中的控制器
【发布时间】:2012-01-21 08:32:12
【问题描述】:

我需要创建下一个结构:

+控制器 ++管理员 +++目录 ++++category.php ++++产品.php +++用户

我需要通过 url /admin/catalog/category/action/param 打开它们 我尝试创建路线:

 Route::set('admin', '(<directory>(/<controller>(/<action>(/<custom_param>))))',array(
        'directory' => '(admin/.*)'
    ))
    ->defaults(array(
        'controller'  => 'dashboard',
        'action'        => 'index'
    ));

【问题讨论】:

  • 嘿,有人回答了吗?我也被这件事难住了。

标签: php kohana kohana-3 routes


【解决方案1】:

未测试:

Route::set('admin', 'admin/<directory>/(<controller>(/<action>(/<custom_param>)))',
    array(
        'directory' => '(catalog|users)'
    ))
    ->defaults(array(
        'controller' => 'dashboard',
        'action'     => 'index',
    ));

【讨论】:

    猜你喜欢
    • 2015-12-11
    • 2015-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多