本文整理匯總了PHP中Barryvdh\Debugbar\LaravelDebugbar::addCollector方法的典型用法代碼示例。如果您正苦於以下問題:PHP LaravelDebugbar::addCollector方法的具體用法?PHP LaravelDebugbar::addCollector怎麽用?PHP LaravelDebugbar::addCollector使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Barryvdh\Debugbar\LaravelDebugbar
的用法示例。
在下文中一共展示了LaravelDebugbar::addCollector方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: register
/**
* @param EntityManagerInterface $em
* @param Configuration $configuration
*/
public function register(EntityManagerInterface $em, Configuration $configuration)
{
if ($this->debugbar->hasCollector('doctrine')) {
$debugStack = $this->debugbar->getCollector('doctrine')->getDebugStack();
} else {
$debugStack = new DebugStack();
$this->debugbar->addCollector(new DoctrineCollector($debugStack));
}
$configuration->setSQLLogger($debugStack);
}
示例2: boot
public function boot(LaravelDebugbar $debugBar, EventDispatcher $eventDispatcher, ViewComposerCollector $viewComposerCollector)
{
$eventDispatcher->listen("creating: *", function (View $view) use($viewComposerCollector, $eventDispatcher) {
foreach ($this->findApplicableComposers($view, $eventDispatcher) as $composer) {
$viewComposerCollector->addViewComposer($view, $composer);
}
});
$debugBar->addCollector($viewComposerCollector);
}
示例3: addCollector
/**
* Adds a data collector
*
* @param \DebugBar\DataCollectorInterface $collector
* @throws DebugBarException
* @return $this
* @static
*/
public static function addCollector($collector)
{
//Method inherited from \DebugBar\DebugBar
return \Barryvdh\Debugbar\LaravelDebugbar::addCollector($collector);
}