Contao\CoreBundle\Config\ResourceFinderInterface::findIn PHP Method

findIn() public method

Appends the subpath to the resource paths and returns a Finder object.
public findIn ( string $subpath ) : Finder
$subpath string
return Symfony\Component\Finder\Finder
    public function findIn($subpath);

Usage Example

示例#1
0
 /**
  * Generates the template mapper array.
  *
  * @param string $cacheDir The cache directory
  */
 private function generateTemplateMapper($cacheDir)
 {
     $mapper = [];
     try {
         $files = $this->finder->findIn('templates')->name('*.html5');
     } catch (\InvalidArgumentException $e) {
         $files = [];
     }
     foreach ($files as $file) {
         $mapper[$file->getBasename('.html5')] = strtr($file->getPath(), '\\', '/');
     }
     $this->filesystem->dumpFile($cacheDir . '/contao/config/templates.php', sprintf("<?php\n\nreturn %s;\n", var_export($mapper, true)));
 }
All Usage Examples Of Contao\CoreBundle\Config\ResourceFinderInterface::findIn
ResourceFinderInterface