Example #1
0
 public function createUrlFromRoute($route, $isXHtml = false)
 {
     preg_match('/^([a-z]{2})\\//', $route, $match);
     $varSuffix = isset($match[1]) ? '_' . $match[1] : '';
     foreach ($this->langReplaces as $needle => $replace) {
         $repl = !empty($replace['record'][$replace['field'] . $varSuffix]) ? $replace['record'][$replace['field'] . $varSuffix] : (isset($replace['record'][$replace['field']]) ? $replace['record'][$replace['field']] : '');
         if ($repl) {
             $repl = createHandleString($repl);
             if ($repl != $needle) {
                 $route = str_replace($needle, $repl, $route);
             }
         }
     }
     return parent::createUrlFromRoute($route, $isXHtml);
 }