GithubHelp home page GithubHelp logo

Route怎么实现可选参数呢? about mix HOT 6 CLOSED

mix-php avatar mix-php commented on August 21, 2024
Route怎么实现可选参数呢?

from mix.

Comments (6)

onanying avatar onanying commented on August 21, 2024

问题描述的不详细,是要在路由加自己的参数吧,看看文档:https://www.kancloud.cn/onanying/mixphp1/379961

from mix.

SyanH avatar SyanH commented on August 21, 2024

加参数这个文档里有,我的意思是加可选参数,就是可以带和不带这个参数都可以匹配到,不带的话会有个默认值

from mix.

onanying avatar onanying commented on August 21, 2024

正常是没有做这样的功能,不过,参数是正则,patterns 字段内,你使用正则应该可以实现。

from mix.

onanying avatar onanying commented on August 21, 2024

但是平时做项目,通常我不会设计像你说的这样类型的 url 。

from mix.

onanying avatar onanying commented on August 21, 2024

我会做两条规则,带参数一条规则,不带的一条规则

from mix.

SyanH avatar SyanH commented on August 21, 2024

好的,谢谢~
框架不错,正在研究使用

from mix.

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.