本文整理匯總了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";
}