Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望成为:offset可选的。
:offset
Router::connect('/some_page/{:offset}/', ...
所以:
Router::connect('/some_page/', ... Router::connect('/some_page/{:offset}/', ...
两者都走同一条路线。可能吗?
首先改变顺序:
Router::connect('/some_page/{:offset}/', ... Router::connect('/some_page/', ...
然后在控制器中检查是否offset设置:
offset
isset($this->request->params['offset'])