当前位置: 首页>>代码示例>>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;未经允许,请勿转载。