当尝试访问
时,我在Kohana中不断收到此错误http://example.com/dailysales当我在制作的时候。在本地它工作得很好…此外,当试图进入产品通知它的工作…我的引导也是一样的…
这是我的bootstrap路由
Route::set('notifications', '(<controller>)(/<action>)', array('controller' => 'notifications|dailysales', 'action' => 'index|send'))
->defaults(array('controller' => 'notifications', 'action' => 'index'));
Route::set('sales', 'sales(/<action>)', array('action' => 'index|export'))
->defaults(array('controller' => 'sales', 'action' => 'index'));
首先,第一条路由不应该有2个可选参数。其次,在正则表达式中放入括号。第三,更具体的路由应该放在前面:
Route::set('sales', 'sales(/<action>)', array('action' => '(index|export)'))
->defaults(array(
'controller' => 'sales',
'action' => 'index'
));
Route::set('notifications', '<controller>(/<action>)', array(
'controller' => '(notifications|dailysales)',
'action' => '(index|send)'
))
->defaults(array(
'controller' => 'notifications',
'action' => 'index'
));
最后,检查您的Kohana::$environment
是否设置正确,"开发"是否与"生产"有任何差异(每个环境的不同配置)。最后要责备的是PHP的版本。