hasWidgets() public method

Check if a type / location has widgets in the queue.
public hasWidgets ( string $location = null, string $zone = Zone::FRONTEND ) : boolean
$location string Location (e.g. 'dashboard_aside_top')
$zone string Either Zone::FRONTEND or Zone::BACKEND
return boolean
Example #1
0
 public function testHasWidgetsNoLocationStrict()
 {
     $app = $this->getStrictVariablesApp(true);
     $handler = new WidgetHandler($app);
     $widget = (new Widget())->setZone('frontend')->setLocation('gum-tree')->setContent('<blink>Drop Bear Warning!</blink>');
     $this->setExpectedException('InvalidArgumentException', 'haswidgets() requires a location, none given');
     $app['asset.queue.widget']->add($widget);
     $handler->hasWidgets();
 }