當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Storage::directories方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Storage::directories方法的典型用法代碼示例。如果您正苦於以下問題:PHP Storage::directories方法的具體用法?PHP Storage::directories怎麽用?PHP Storage::directories使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\Storage的用法示例。


在下文中一共展示了Storage::directories方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: lists

 /**
  * Get a list of the theme directories.
  * @return array
  */
 public static function lists()
 {
     $themes = Storage::directories('resources/views/themes');
     return array_map(function ($theme) {
         return basename($theme);
     }, $themes);
 }
開發者ID:flashtag,項目名稱:front,代碼行數:11,代碼來源:Theme.php

示例2: lists

 public static function lists()
 {
     $templates = Storage::directories('resources/views/vendor/front');
     return array_map(function ($template) {
         return basename($template);
     }, $templates);
 }
開發者ID:flashtag,項目名稱:front,代碼行數:7,代碼來源:Template.php

示例3: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param $cluster
  * @return Response
  */
 public function edit(Cluster $cluster)
 {
     $directories = Storage::directories('axl/');
     $versions = [];
     foreach ($directories as $directory) {
         preg_match('/\\/(.*)/', $directory, $matches);
         $versions[$matches[1]] = $matches[1];
     }
     return view('cluster.edit', compact('cluster', 'versions'));
 }
開發者ID:tindase,項目名稱:uc-insight,代碼行數:16,代碼來源:ClusterController.php

示例4: index

 /**
  * Show list of uploaded files
  *
  * @return mixed
  */
 public function index()
 {
     $files = Storage::directories(getUploadDirectory());
     //Remove foldername
     foreach ($files as &$file) {
         $file = str_replace(getUploadDirectory() . '/', '', $file);
         //On Linux systems
         $file = str_replace(getUploadDirectory() . '\\', '', $file);
         //On Windows systems
     }
     return $files;
 }
開發者ID:phileserver,項目名稱:core,代碼行數:17,代碼來源:FileController.php

示例5: createSubDirectoryList

 /**
  * Returns an object of all directories within a directory
  * @param $dir
  * @return \stdClass
  */
 protected function createSubDirectoryList($dir)
 {
     $folder = new \stdClass();
     $folder->name = basename($dir);
     $folder->path = $dir;
     $folder->sub_directories = [];
     $folder->show_sub_directories = false;
     $folder->active = false;
     $folder->parent_directory = dirname($dir);
     $directories = Storage::directories($dir);
     foreach ($directories as $dir) {
         $folder->sub_directories[] = $this->createSubDirectoryList($dir);
     }
     $folder->hasSubDirectories = count($folder->sub_directories) > 0;
     return $folder;
 }
開發者ID:larapress,項目名稱:larapress,代碼行數:21,代碼來源:MediaController.php

示例6: checkIfPageExists

 /**
  * Check if a directory or a file already exists in the current directory
  * @param  string $name file or directory name
  * @param  string $path current directory path
  * @param  string $type search a file or a directory
  * @return bool
  */
 public function checkIfPageExists($name, $path, $type = 'file')
 {
     if ($type === 'file') {
         $files = Storage::files($path);
         foreach ($files as $file) {
             $explodeFilePath = explode('/', $file);
             $fileName = explode('.', $explodeFilePath[count($explodeFilePath) - 1])[0];
             if ($name === $fileName) {
                 return true;
             }
         }
     } else {
         $directories = Storage::directories($path);
         foreach ($directories as $directory) {
             $explodeFilePath = explode('/', $directory);
             $fileName = $explodeFilePath[count($explodeFilePath) - 1];
             if ($name === $fileName) {
                 return true;
             }
         }
     }
     return false;
 }
開發者ID:mrjuliuss,項目名稱:lecter,代碼行數:30,代碼來源:Lecter.php

示例7: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param $id
  * @return Response
  * @internal param $cluster
  */
 public function edit($id)
 {
     $cluster = $this->cluster->find($id);
     $activeClusterId = \Auth::user()->activeClusterId();
     $directories = Storage::directories('app/axl/');
     $versions = [];
     foreach ($directories as $directory) {
         preg_match('/\\/axl\\/(.*)/', $directory, $matches);
         $versions[$matches[1]] = $matches[1];
     }
     return view('cluster.edit', compact('cluster', 'activeClusterId', 'versions'));
 }
開發者ID:sloan58,項目名稱:uc-insight-esk,代碼行數:19,代碼來源:ClusterController.php


注:本文中的Illuminate\Support\Facades\Storage::directories方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。