Get the pagename of the URL
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']
精彩评论