Blog\Module::dashboard PHP Method

dashboard() public method

Display widget dashboard
public dashboard ( Zend\EventManager\EventInterface $event ) : void
$event Zend\EventManager\EventInterface Event
return void
    public function dashboard(Event $event)
    {
        $commentModel = new Comment();
        $unactiveCommentList = $commentModel->getList(null, false);
        $activeCommentList = $commentModel->getList(null, true);
        $widgets = $event->getParam('widgets');
        $widgets['blog']['id'] = 'blog';
        $widgets['blog']['title'] = 'Blog information';
        $widgets['blog']['content'] = $this->addPath(__DIR__ . '/views')->render('dashboard.phtml', array('unactiveComments' => count($unactiveCommentList), 'activeComments' => count($activeCommentList)));
        $event->setParam('widgets', $widgets);
    }