亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

CompileEngine.php-1

標簽:
PHP

namespace Illuminate\View\Engines;

 

use Exception;

use ErrorException;

use Illuminate\View\Compilers\CompilerInterface;

// namespace

class CompilerEngine extends PhpEngine

{// class CompilerEngine extends PhpEngine

    /**

     * The Blade compiler instance.

     *

     * @var \Illuminate\View\Compilers\CompilerInterface

     */

    protected $compiler;// The Blade compiler instance

 

    /**

     * A stack of the last compiled templates.

     *

     * @var array

     */

    protected $lastCompiled = [];// a stack of the last compiled templates

 

    /**

     * Create a new Blade view engine instance.

     *

     * @param  \Illuminate\View\Compilers\CompilerInterface  $compiler

     * @return void

     */

    public function __construct(CompilerInterface $compiler)

    {

        $this->compiler = $compiler;// must be set or right

    }//Create a new blade view engine instance

 

    /**

     * Get the evaluated contents of the view.

     *

     * @param  string  $path

     * @param  array   $data

     * @return string

     */

    public function get($path, array $data = [])

    {// evaluated contents of the view.

        $this->lastCompiled[] = $path;// this path  be set

 

        // If this given view has expired, which means it has simply been edited since

        // it was last compiled, we will re-compile the views so we can evaluate a

        // fresh copy of the view. We'll pass the compiler the path of the view.

        if ($this->compiler->isExpired($path)) {

            $this->compiler->compile($path);

        }// If this given view has expired, which means it has simply been edited since

       // it was last compiled, we will re-compile the views so we can evaluate a

       // fresh copy of the view. we'll pass the compiler the path of the view.

 

        $compiled = $this->compiler->getCompiledPath($path);//get compiled Path

 

        // Once we have the path to the compiled file, we will evaluate the paths with

        // typical PHP just like any other templates. We also keep a stack of views

        // which have been rendered for right exception messages to be generated.

        $results = $this->evaluatePath($compiled, $data);

       // Once we have the path to the compiled file, we will evaluate the paths with

       // typical PHP just like any other templates. we also keep a stack of views

       //which have been rendered for right exception messages to be generated

 

        array_pop($this->lastCompiled);

 

        return $results;

    }// get the results.

點擊查看更多內容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優質文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學習,寫下你的評論
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優惠券免費領

立即參與 放棄機會
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

舉報

0/150
提交
取消