Admin_CommentCommenterController::indexAction PHP Метод

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

public indexAction ( )
    public function indexAction()
    {
        $translator = \Zend_Registry::get('container')->getService('translator');
        $this->getHelper('contextSwitch')->addActionContext('index', 'json')->initContext();
        $table = $this->getHelper('datatable');
        $table->setDataSource($this->commenterRepository);
        $table->setOption('oLanguage', array('oPaginate' => array('sFirst' => $translator->trans('First', array(), 'comments'), 'sLast' => $translator->trans('Last', array(), 'comments'), 'sNext' => $translator->trans('Next'), 'sPrevious' => $translator->trans('Previous')), 'sZeroRecords' => $translator->trans('No records found.', array(), 'comments'), 'sSearch' => $translator->trans('Search'), 'sInfo' => $translator->trans('Showing _START_ to _END_ of _TOTAL_ entries', array(), 'comments'), 'sEmpty' => $translator->trans('No entries to show', array(), 'comments'), 'sInfoFiltered' => $translator->trans(' - filtering from _MAX_ records', array(), 'comments'), 'sLengthMenu' => $translator->trans('Display _MENU_ records', array(), 'comments'), 'sInfoEmpty' => ''));
        $table->setCols(array('time_created' => $translator->trans('Date Created', array(), 'comments'), 'name' => $translator->trans('Name'), 'user' => $translator->trans('Username', array(), 'comments'), 'email' => $translator->trans('Email', array(), 'comments'), 'url' => $translator->trans('Website', array(), 'comments'), 'ip' => $translator->trans('Ip', array(), 'comments'), 'edit' => $translator->trans('Edit'), 'ban' => $translator->trans('Ban', array(), 'comments'), 'delete' => $translator->trans('Delete')));
        $view = $this->view;
        $table->setHandle(function ($commenter) use($view) {
            $urlParam = array('commenter' => $commenter->getId());
            return array($commenter->getTimeCreated()->format('Y-i-d H:i:s'), $commenter->getName(), $commenter->getUsername(), $commenter->getEmail(), $commenter->getUrl(), $commenter->getIp(), $view->linkEdit($urlParam), $view->linkBan($urlParam), $view->linkDelete($urlParam));
        });
        $table->dispatch();
    }