Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function modify($source, $namespace, $name)
 {
     //Translator options must automatically route this view name to specific domain
     $domain = $this->translator->resolveDomain($this->options['prefix'] . str_replace(['/', '\\'], '-', $namespace . '-' . $name));
     return preg_replace_callback($this->options['pattern'], function ($matches) use($domain) {
         return $this->translator->trans($matches[1], [], $domain);
     }, $source);
 }