DebugKit\Routing\Filter\DebugBarFilter::beforeDispatch PHP Метод

beforeDispatch() публичный Метод

Call the initialize method onl all the loaded panels.
public beforeDispatch ( Cake\Event\Event $event ) : void
$event Cake\Event\Event The beforeDispatch event.
Результат void
    public function beforeDispatch(Event $event)
    {
        foreach ($this->_registry->loaded() as $panel) {
            $this->_registry->{$panel}->initialize();
        }
    }

Usage Example

Пример #1
0
 /**
  * Test that beforeDispatch call initialize on each panel
  *
  * @return void
  */
 public function testBeforeDispatch()
 {
     $bar = new DebugBarFilter($this->events, []);
     $bar->setup();
     $this->assertNull(Log::config('debug_kit_log_panel'));
     $event = new Event('Dispatcher.beforeDispatch');
     $bar->beforeDispatch($event);
     $this->assertNotEmpty(Log::config('debug_kit_log_panel'), 'Panel attached logger.');
 }