我需要有一个网址,例如 example/controller/ my-page-with-dashes
I need to have a URL such as example/controller/my-page-with-dashes
如何在Kohana中使用网址?我试着创建一个控制器,并命名操作 myPageWithDashes 像在Zend框架,但没有工作。
How can I have such as URL in Kohana? I tried creating a controller and name the action myPageWithDashes like in the Zend Framework but that didn't work. Any idea how it should be done?
推荐答案复制文件 system / classes / kohana / request / client / internal.php 到您的应用程序文件夹 - application / classes / kohana / request / client / internal.php 。然后从
Copy the file system/classes/kohana/request/client/internal.php to your application folder - application/classes/kohana/request/client/internal.php. Then change line 106 from:
$action = $request->action();到:
$action = str_replace('-', '_', $request->action());更多推荐
如何在Kohana 3.x中使用破折号的网址
发布评论