[英]How to check the url in the controller slim-framework
I have problem with slim
我
slim
有问题
I have the controllar, and 2 routs send to this controller. 我有控制者,并且有2条溃败发送给该控制器。
Now I need to check, if I request with this url: /product/{slug}
现在,我需要检查是否需要以下网址:
/product/{slug}
return the twig (I do the return). 退回树枝(我退货)。
and if I request to url: api/product/{slug}
return me the json (i do the return). 如果我请求url:
api/product/{slug}
我返回json(我会返回)。
now I don't know how to the the if request. 现在,我不知道如何处理if要求。 and how I just to know check what url request that controller.
以及我如何知道检查哪个URL请求该控制器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.