Coder Social home page Coder Social logo

Comments (3)

Kavf avatar Kavf commented on May 1, 2024 1

谢谢,按您的方法已经解决了
自定义路由改成这样了
'adm/<method:[\w_]+>/<action:[\w_]+>' => 'adm<method>/<action>'
2017-11-14 00-15-43
2017-11-14 00-13-56

如果文件名严格按照驼峰命名的话,第二层路由首字母需要大写,这样也好,不容易让人猜到 ==。

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

可以通过 /config/config.php 中routeRule 配置有规则的三层路由 例如:
'admin/<method:[\w_]+>/<action:[\w_]+>' => '<method>/admin_<action>',
那 /admin/article/add 就会自动找到 articleAction.php 中的 action_admin_add() 方法了
具体配置方法可以参考 http://www.billge.cc/#router-custom

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

'admin/<method:[\w_]+>/<action:[\w_]+>' => '<method>Admin/<action>'
这样可能对环境隔离更合理些 admin/article/add => articleAdminAction.php 中的 action_add() 方法

from biny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.