original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Resolve page title by pattern.
  
  @param string         $pattern
  @param Siteroot       $siteroot
  @param ElementVersion $elementVersion
  @param string         $language
  
  @return string
docstring_tokens: Resolve page title by pattern .