如何在extbase扩展 Controller 中获取当前页面的uri?如果我需要通过电子邮件发送当前 uri 或将其保存到数据库以供以后使用或统计。
最佳答案
您可以使用这一行:
$this->uriBuilder->getRequest()->getRequestUri()
例子:
public function newAction(Tx_YourExtension_Domain_Model_YourModel $yourModel = NULL) {
$this->view->assign('yourModel', $yourModel);
$this->view->assign('url', $this->uriBuilder->getRequest()->getRequestUri());
}
关于controller - EXTBASE:如何在 extbase Controller 中获取当前页面 uri?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17951551/