public function getFrontendUrl($strParams = null, $strForceLang = null)
{
if ($strForceLang !== null) {
@trigger_error('Using PageModel::getFrontendUrl() with $strForceLang has been deprecated and will no longer work in Contao 5.0.', E_USER_DEPRECATED);
}
$this->loadDetails();
$objUrlGenerator = \System::getContainer()->get('contao.routing.url_generator');
$strUrl = $objUrlGenerator->generate(($this->alias ?: $this->id) . $strParams, array('_locale' => $strForceLang ?: $this->rootLanguage, '_domain' => $this->domain, '_ssl' => (bool) $this->rootUseSSL));
// Make the URL relative to the base path
if (0 === strpos($strUrl, '/')) {
$strUrl = substr($strUrl, strlen(\Environment::get('path')) + 1);
}
$strUrl = $this->applyLegacyLogic($strUrl, $strParams);
return $strUrl;
}