Beispiel #1
0
 /**
  * Return template $path from mask with forwarded values.
  *
  * @param $name
  * @param $mask
  * @param string $view
  * @param string $suffix
  *
  * @throw FileNotFound
  * @return string
  */
 private function parseMask($mask, $name, $view, $suffix)
 {
     $mask = strtolower($mask);
     if (!isset($this->masks[$mask])) {
         throw new ViewMaskNotFound("Mask '{$mask}' not found.");
     }
     $matcher = new UrlMatcher\Matcher($this->masks[$mask], ['module' => Strings::strbefore($name, ':'), 'name' => Strings::strafter($name, ':', $name), 'view' => $view]);
     $path = $matcher->parse();
     if ($suffix === '' || $suffix != null) {
         $path = $path . '.' . $suffix;
     }
     return $path;
 }
Beispiel #2
0
 private function parseViewMask($mask)
 {
     $matcher = new Matcher($mask, ['themeName' => $this->name, 'themeDir' => $this->getThemeDir(), 'assetsDir' => $this->getAssetsDir()]);
     return $matcher->parse();
 }