本文整理汇总了PHP中Illuminate\View\View::getFactory方法的典型用法代码示例。如果您正苦于以下问题:PHP View::getFactory方法的具体用法?PHP View::getFactory怎么用?PHP View::getFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\View\View
的用法示例。
在下文中一共展示了View::getFactory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compose
public function compose(View $view)
{
$page = app('Page');
/** @var $page Page */
$view->with('page', $page);
$factory = $view->getFactory();
$deferredScripts = null;
// Add deferred scripts to page footer //
if ($page->section('footerScripts')) {
$deferredScripts = false;
$factory->startSection($page->section('footerScripts'), new ViewBlock(function () use($page) {
return $page->script()->render(true);
}));
}
$factory->startSection($page->section('htmlTagAttributes'), $page->htmlTagAttributes());
$factory->startSection($page->section('bodyTagAttributes'), $page->bodyTagAttributes());
//--Page head--//
$factory->startSection($page->section('head'), new ViewBlock(function () use($page, $deferredScripts) {
return "\t" . $page->meta()->charset->render() . "\n" . "\t<title>" . htmlspecialchars($page->title) . "</title>\n" . $page->meta()->render() . $page->links()->render() . $page->style()->render() . $page->script()->render($deferredScripts);
}));
}
示例2: compose
/**
* @param View $view
*/
public function compose(View $view)
{
$view->getFactory()->inject('mail_notify_setting', $this->renderHtml());
$view->getFactory()->inject('mail_notify_setting_addJs', $this->renderJs());
$view->getFactory()->inject('mail_notify_setting_addCss', $this->renderCss());
}