コード例 #1
0
 protected function registerViewPaths()
 {
     $view = $this->app->make('view');
     foreach ($this->fs->directories(resources_path('views')) as $dir) {
         $ns = Path::getDirectoryName($dir);
         $view->addNamespace($ns, $dir);
     }
 }
コード例 #2
0
ファイル: Factory.php プロジェクト: EvolveOraView/core
 /**
  * Scans the configured documentation root directory for projects and resolves them and puts them into the projects collection
  *
  * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
  */
 protected function resolveProjects()
 {
     if (!$this->projects->isEmpty()) {
         return;
     }
     /**
      * @var \Codex\Core\Menus\Node $projectsMenu
      */
     #$projectsMenu = $this->menus->add('projects_menu');
     $finder = new Finder();
     $projects = $finder->in($this->rootDir)->files()->name('config.php')->depth('<= 1')->followLinks();
     foreach ($projects as $projectDir) {
         /** @var \SplFileInfo $projectDir */
         $name = Path::getDirectoryName($projectDir->getPath());
         $config = $this->getContainer()->make('fs')->getRequire($projectDir->getRealPath());
         $config = array_replace_recursive($this->config('default_project_config'), $config);
         $project = $this->getContainer()->make(Project::class, ['codex' => $this, 'name' => $name, 'config' => $config]);
         $this->runHook('project:make', [$this, $project]);
         $this->projects->put($name, $project);
         //            $projectsMenu->add($name, $name, 'root', [ ], [
         //                'href' => $this->url($project)
         //            ]);
     }
 }