URL
If your current browser URL is "https://example.se/om-oss/historia". Then to root is "https://example.se/" and URI is "/om-oss/historia".
Se usage examples bellow using the above URL (ROOT+URI).
Get root URL
<?php echo $this->modal()->url()->root(); ?>
Result: https://example.se
Get full URL
<?php echo $this->modal()->url()->url(); ?>
Result: https://example.se/om-oss/historia
Get full URL but only part "Page" from active "ROUTE"
<?php echo $this->modal()->url()->select("page")->url(); ?>
Result: https://example.se/om-oss/historia
Get full URL and multiple parts "Page, id, permalink" from active "ROUTE"
<?php echo $this->modal()->url()->select(["page", "id", "permalink"])->url(); ?>
Result: https://example.se/news/122/our-first-post
Get full uri path
<?php echo $this->modal()->url()->path(); ?>
Result: /om-oss/historia
Get current URI parameter
<?php echo $this->modal()->url()->current(); ?>
Result: historia
Get part of current URI parameter
IF THE URI IS: "/news/id-12"
<?php echo $this->modal()->url()->current("-"); ?>
Result: 12
If you have for example a router like this is "p-\d+", then you can easly get the id by searching for the char seperator
Prepend to URI and return full URL
<?php echo $this->modal()->url()->prepend(["test", "test2"])->url(); ?>
Result: https://example.se/test/test2/om-oss/historia
Append to URI and return full URL
<?php echo $this->modal()->url()->append(["test", "test2"])->url(); ?>
Result: https://example.se/om-oss/historia/test/test2
Working with parmeter array
Prepend and append works like above.
Append to URI and return full URL
<?php print_r($this->modal()->url()->get()); ?>
Result: Array ([page] => Array ( [0] => om-oss [1] => historia))
Append to URI and return full URL
<?php print_r($this->modal()->url()->select("page")->get()); ?>
Result: Array ([0] => om-oss [1] => historia)