开发者

Get the pagename of the URL

开发者 https://www.devze.com 2023-01-23 09:41 出处:网络
I have a url like this: http://www.sample.com/widget/mywidget/ How can I get only the \"mywidget\" in开发者_运维知识库 the url?Try debug($this->params) inside your controller and have a look at wh

I have a url like this: http://www.sample.com/widget/mywidget/

How can I get only the "mywidget" in开发者_运维知识库 the url?


Try debug($this->params) inside your controller and have a look at what's available inside the array.

You will find a number of URL parts inside that property, including the 'action' key, which I think is what you're looking for.


You can try the code below:

echo $this->params->pass['1']
0

精彩评论

暂无评论...
验证码 换一张
取 消