如何根據(jù)用戶(hù)post過(guò)來(lái)的某個(gè)字段設(shè)置路由呢?
比如 http://localhost/api/index.php 用戶(hù)post 了一個(gè)字段為methods = UserController.LoginAction
其實(shí)應(yīng)該調(diào)用app\controller 下的 UserController中的Login方法 但是路由這一塊不知道怎么設(shè)置。。 能給個(gè)例子么謝謝呢
該如何設(shè)置路由呢?
難道應(yīng)該在indexController 里面的index 方法里直接 new UserController 然后調(diào)用對(duì)應(yīng)方法么? 感覺(jué)有點(diǎn)不對(duì)。出此接觸workman沒(méi)有思路。
沒(méi)有找到相關(guān)方案
暫時(shí)性解決 通過(guò) 閉包的形式 但是感覺(jué)很不優(yōu)雅