Esempio n. 1
0
 /**
  * Returns the absolute file path.
  * @param \Cms\Classes\ComponentBase $component Specifies a component the file belongs to.
  * @param string$fileName Specifies the file name to return the path to.
  * @return string
  */
 public static function getFilePath($component, $fileName)
 {
     $path = $component->getPath() . '/' . $fileName;
     /*
      * Check the shared "/partials" directory for the partial
      */
     if (!File::isFile($path)) {
         $sharedDir = dirname($component->getPath()) . '/partials';
         $sharedPath = $sharedDir . '/' . $fileName;
         if (File::isFile($sharedPath)) {
             return $sharedPath;
         }
     }
     return $path;
 }
 /**
  * Returns the absolute file path.
  * @param \Cms\Classes\ComponentBase $component Specifies a component the file belongs to.
  * @param string$fileName Specifies the file name to return the path to.
  * @return string
  */
 public static function getFilePath($component, $fileName)
 {
     return $component->getPath() . '/' . $fileName;
 }