本文整理汇总了PHP中Illuminate\View\Compilers\BladeCompiler::getCompiledPath方法的典型用法代码示例。如果您正苦于以下问题:PHP BladeCompiler::getCompiledPath方法的具体用法?PHP BladeCompiler::getCompiledPath怎么用?PHP BladeCompiler::getCompiledPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\View\Compilers\BladeCompiler
的用法示例。
在下文中一共展示了BladeCompiler::getCompiledPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getCompiledPath
/**
* Get the path to the compiled version of a view.
*
* @param string $path
* @return string
* @static
*/
public static function getCompiledPath($path)
{
//Method inherited from \Illuminate\View\Compilers\Compiler
return \Illuminate\View\Compilers\BladeCompiler::getCompiledPath($path);
}
示例4: getCompiledPath
/**
* method just adds extension .php to parents' compiled path
*
* @param string $path
* @return string
*/
public function getCompiledPath($path)
{
return parent::getCompiledPath($path) . ".php";
}