public function replacePattern($pattern, Siteroot $siteroot, ElementVersion $elementVersion, $language)
    {
        $replace = [
            '%s' => $siteroot->getTitle(),
            '%b' => $elementVersion->getBackendTitle($language),
            '%p' => $elementVersion->getPageTitle($language),
            '%n' => $elementVersion->getNavigationTitle($language),
            '%r' => $this->projectTitle,
        ];

        return str_replace(array_keys($replace), array_values($replace), $pattern);
    }
public function replacePattern($pattern, Siteroot $siteroot, ElementVersion $elementVersion, $language)
    {
        $replace = [
            '%s' => $siteroot->getTitle(),
            '%b' => $elementVersion->getBackendTitle($language),
            '%p' => $elementVersion->getPageTitle($language),
            '%n' => $elementVersion->getNavigationTitle($language),
            '%r' => $this->projectTitle,
        ];

        return str_replace(array_keys($replace), array_values($replace), $pattern);
    }
public function replacePattern ( $ pattern , Siteroot $ siteroot , ElementVersion $ elementVersion , $ language ) { $ replace = [ '%s' => $ siteroot -> getTitle ( ) , '%b' => $ elementVersion -> getBackendTitle ( $ language ) , '%p' => $ elementVersion -> getPageTitle ( $ language ) , '%n' => $ elementVersion -> getNavigationTitle ( $ language ) , '%r' => $ this -> projectTitle , ] ; return str_replace ( array_keys ( $ replace ) , array_values ( $ replace ) , $ pattern ) ; }
Resolve page title by pattern.

@param string         $pattern
@param Siteroot       $siteroot
@param ElementVersion $elementVersion
@param string         $language

@return string
Resolve page title by pattern .