Home  >  Q&A  >  body text

Alias ​​routing prompt parameter error

think\Route::rule('add/:n/:m','index/demo/add'); It is OK to access tp5.com/add/5/6 from this address.

think\Route::alias('math','index/demo'); // Change to alias route to access tp5.com/math/add/5/6 This will prompt

Method parameter error: n

throw new \InvalidArgumentException('method param miss:' . $name);




电动小老虎电动小老虎2502 days ago1825

reply all(1)I'll reply

  • 电动小老虎

    电动小老虎2017-11-16 21:06:52

    'url_param_type' => 1, If ​​you need to use routing aliases, they must be parsed in order, not key-value pairs. Otherwise, it will prompt that there are few parameters. . . . . .

    reply
    0
  • Cancelreply