当我执行 /mycontroller/search 时,它只显示“/mycontroller”,但是当我在方法中时如何获得“/mycontroller/search”,当我在search
方法中时如何获得“/mycontroller/other” other
。
class Mycontroller extends Zend_Controller_Action
{
private $url = null;
public function otherAction() {
$this->url .= "/" . $this->getRequest()->getControllerName();
echo $this->url; // output: /mycontroller
exit;
}
public function searchAction() {
$this->url .= "/" . $this->getRequest()->getControllerName();
echo $this->url; // output: /mycontroller
// expect: /mycontroller/search
exit;
}
}