Blog\Plugin\CommentList::__invoke PHP Метод

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

Invoke form
public __invoke ( ) : string
Результат string
    public function __invoke()
    {
        $commentTable = new Blog\Model\Comment();
        $document = $this->getServiceLocator()->get('Zend\\View\\Renderer\\PhpRenderer')->plugin('CurrentDocument');
        $comments = $commentTable->getList($document()->getId());
        return $this->addPath(__DIR__ . '/../views')->render('plugin/comment-list.phtml', array('comments' => $comments));
    }

Usage Example

Пример #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testInvoke()
 {
     $this->assertInternalType('string', $this->object->__invoke());
 }
CommentList