public function ModalPage::getCurrentPath in Modal 8.2
Same name and namespace in other branches
- 8.3 src/ModalPage.php \Drupal\modal_page\ModalPage::getCurrentPath()
Get the current path.
Return value
string The current path.
1 call to ModalPage::getCurrentPath()
- ModalPage::getModalToShow in src/
ModalPage.php - Get modal to show.
File
- src/
ModalPage.php, line 236
Class
- ModalPage
- Modal Page Class.
Namespace
Drupal\modal_pageCode
public function getCurrentPath() : string {
// $currentPath = ltrim($this->request->getRequestUri(), '/');.
$currentPath = $this->request
->getRequestUri();
if ($this->pathMatcher
->isFrontPage()) {
$currentPath = '<front>';
}
return $currentPath;
}