本文整理汇总了PHP中Illuminate\View\Compilers\BladeCompiler::getPath方法的典型用法代码示例。如果您正苦于以下问题:PHP BladeCompiler::getPath方法的具体用法?PHP BladeCompiler::getPath怎么用?PHP BladeCompiler::getPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\View\Compilers\BladeCompiler
的用法示例。
在下文中一共展示了BladeCompiler::getPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compileViews
/**
* Compile views.
*
* @param array $paths
* @param string $storagePath
* @return $this
*/
public function compileViews(array $paths, $storagePath)
{
$this->makeDestination($storagePath);
$compiler = new BladeCompiler($this->files, $storagePath);
foreach ($paths as $path) {
$files = $this->files->glob(realpath($path) . '/{,**/}*.php', GLOB_BRACE);
foreach ($files as $file) {
if (!Str::endsWith(strtolower($file), '.blade.php')) {
continue;
}
$compiler->setPath($file);
$contents = $this->parseToken($this->files->get($file));
$contents = $compiler->compileString($contents);
$compiledPath = $compiler->getCompiledPath($compiler->getPath());
$this->files->put($compiledPath . '.php', $contents);
}
}
return $this;
}
示例2: handle
public function handle()
{
$this->info('start view compiler');
$targetDir = storage_path(config('trans.view_store_path'));
if (!file_exists($targetDir)) {
$this->createDirectory($targetDir);
$this->comment('created directory ' . $targetDir);
}
$path = base_path(config('trans.view_blade_path'));
$fs = new Filesystem($path);
$files = $fs->allFiles(realpath($path));
$compiler = new BladeCompiler($fs, $targetDir);
foreach ($files as $file) {
$filePath = $file->getRealPath();
$this->comment('compile view: ' . $filePath);
$compiler->setPath($filePath);
$contents = $compiler->compileString($fs->get($filePath));
$compiledPath = $compiler->getCompiledPath($compiler->getPath());
$fs->put($compiledPath . '.php', $contents);
}
}
示例3: getPath
/**
* Get the path currently being compiled.
*
* @return string
* @static
*/
public static function getPath()
{
return \Illuminate\View\Compilers\BladeCompiler::getPath();
}