[英]how do I get the attributes of “fk_login_cidadao” with php and slim-framework?
[英]How to check the url in the controller slim-framework
我slim
有问题
我有控制者,并且有2条溃败发送给该控制器。
现在,我需要检查是否需要以下网址: /product/{slug}
退回树枝(我退货)。
如果我请求url: api/product/{slug}
我返回json(我会返回)。
现在,我不知道如何处理if要求。 以及我如何知道检查哪个URL请求该控制器。
$request->getUri()->getPath()
将为您提供当前URL。
$request->getAttribute('route')
将给您当前的Route
对象。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.