Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXTBASE: How to get current page uri in extbase controller?

How to get uri of current page in extbase extension controller? In case I need to send current uri via email or save it to database for later use or statistics.

like image 674
gSorry Avatar asked Nov 30 '22 20:11

gSorry


1 Answers

You can use this line:

$this->uriBuilder->getRequest()->getRequestUri()

Example:

public function newAction(Tx_YourExtension_Domain_Model_YourModel $yourModel = NULL) {
    $this->view->assign('yourModel', $yourModel);
    $this->view->assign('url', $this->uriBuilder->getRequest()->getRequestUri());
}
like image 183
gSorry Avatar answered Dec 06 '22 00:12

gSorry