本文整理汇总了PHP中Illuminate\View\View::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP View::__construct方法的具体用法?PHP View::__construct怎么用?PHP View::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\View\View
的用法示例。
在下文中一共展示了View::__construct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create a new view instance.
*
* @param LaravelFactory $environment
* @param \Illuminate\View\Engines\EngineInterface $engine
* @param \Illuminate\Translation\Translator $translator
* @param string $view
* @param string $path
* @param array $data
* @param Store $session
* @return \Jgallred\Simplemessage\View\View
*/
public function __construct(LaravelFactory $environment, EngineInterface $engine, Translator $translator, $view, $path, $data = array(), Store $session = null)
{
parent::__construct($environment, $engine, $view, $path, $data);
$this->translator = $translator;
// If a session driver has been specified, we will bind an instance of the
// message container to every view. If a container instance
// exists in the session, we will use that instance.
if (!isset($this->data[$this->messages_key])) {
if ($session && $session->isStarted() and $session->has($this->messages_key)) {
$this->data[$this->messages_key] = $session->get($this->messages_key);
} else {
$this->data[$this->messages_key] = new TypedMessages();
}
}
}
示例2: __construct
/**
* Create a new view instance.
*
* @param \Illuminate\View\Factory $factory
* @param \Illuminate\View\Compilers\EngineInterface $engine
* @param string $view
* @param string $path
* @param array $data
* @return void
*/
public function __construct(Factory $factory, EngineInterface $engine, $view, $path, $data = array(), Shortcode $shortcode)
{
parent::__construct($factory, $engine, $view, $path, $data);
$this->shortcode = $shortcode;
}