如何在引导程序 (PHP) 中更改根目录


How to change the root in bootstrap (PHP)

我正在使用kohana 3.2.(PHP)我需要重置 xyz.com/ar/contoller/method/argument。它工作正常。

Route::set('default', '(<country_param>(/<controller>(/<action>(/<id>(/<method>)))))')
->defaults(array('controller' => 'auctions','action'  => 'live','method' => NULL));

现在我需要 xyz.com/ar/modules/controller/method/argument。我会改变根。

    Route::set('default', '(<country_param>(/<user_param>(/<controller>(/<action>(/<id>(/<method>))))))')
->defaults(array('controller' => 'auctions','action'  => 'live','method' => NULL));

但它不起作用。你能建议吗?

也许你需要定义变量的模式

Route::set('new_default', '(<country_param>(/<user_param>(/<controller>(/<action>(/<id>(/<method>))))))')
    ->defaults(
        array(
            'controller' => 'auctions',
            'action'  => 'live',
            'method' => NULL,
            'country_param' => '[a-zA-Z0-9_]+',
            'user_param' => '[a-zA-Z0-9_]+',
    ));

不要忘记,每条路线都必须有唯一的名称。