Пример #1
0
 public static function create($registered)
 {
     $cssPath = SJO_ROOT_PUBLIC_HTML . '/css/' . strtolower(Router::$interface);
     if (is_dir($cssPath)) {
         if ($files = Path::listFiles($cssPath)) {
             foreach ($files as $file) {
                 array_push($registered['elements'], preg_replace("#^" . SJO_ROOT_PUBLIC_HTML . "/#", "", $file->path));
             }
         }
     }
     foreach ($registered['elements'] as &$el) {
         $el = self::createStatic('Element', Lib\Arr::extend(self::$element, array('tagname' => 'link', 'attributes' => array('href' => $el))));
     }
     return parent::create($registered);
 }
Пример #2
0
 /**
  * Chargement d'un dossier contenant des fichiers ini
  *
  * @param $paths
  * @param bool $regexp
  * @param string $method
  * @return $this
  */
 public function path($paths, $regexp = false, $method = '{name}')
 {
     $regexp = $regexp ? $regexp : "^(.+)\\.ini\$";
     foreach (Arr::to($paths) as $path) {
         $files = Path::listFiles($path, $regexp);
         if ($files) {
             foreach ($files as $file) {
                 $name = str_replace('-', '_', $file->match[1]);
                 $name = $file->parentname == $name ? $name : str_replace('{name}', $name, $method);
                 $this->parseIniFile($file->path, $name);
             }
         }
     }
     return $this;
 }