栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP

Factory.php

PHP 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Factory.php

 

namespace IlluminateView;

 

use Closure;

use IlluminateSupportArr;

use IlluminateSupportStr;

use InvalidArgumentException;

use IlluminateContractsSupportArrayable;

use IlluminateViewEnginesEngineResolver;

use IlluminateContractsEventsDispatcher;

use IlluminateContractsContainerContainer;

use IlluminateContractsViewFactory as FactoryContract;

// super cool namespace

class Factory implements FactoryContract

{// factory implements the Factory Contract

   

    protected $engines;// The engine implementation

 

   

    protected $finder;//The view finder implementation,this protected

 

   

    protected $events;// the event dispatcher instance

 

   

    protected $container;//The IoC container instance

 

   

    protected $shared = [];//Data that should be available to all templates.

   // this mind may be too expensive

 

   

    protected $aliases = [];// array of registered view name aliases.

 

   

    protected $names = [];//all of the registered view names.

 

   

    protected $extensions = ['blade.php' => 'blade', 'php' => 'php'];

   // The extension to engine bindings.

 

   

    protected $composers = [];//The view composer events

 

   

    protected $sections = [];//All of the finished, captured sections

 

   

    protected $sectionStack = [];//The stack of in-progress sections.

 

   

    protected $renderCount = 0;// The number of active rendering operations.

 

   

    public function __construct(EngineResolver $engines, ViewFinderInterface $finder, Dispatcher $events)

    {// create a new view factory instance.

        $this->finder = $finder;

        $this->events = $events;

        $this->engines = $engines;// get this engines

 

        $this->share('__env', $this);

    }//share env

 

   

    public function file($path, $data = [], $mergeData = [])

    {// get the data

        $data = array_merge($mergeData, $this->parseData($data));

// array_merge

        $this->callCreator($view = new View($this, $this->getEngineFromPath($path), $path, $path, $data));

// callCreator

        return $view;

    }// Get the evaluated view contents for the given view.

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/229711.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号