addElement('hidden', 'idPost'); if (!$this->_getData('identity')) { $this->addElement('text', 'author', ['label' => 'Author', 'required' => true]); $this->addElement( 'email', 'email', ['label' => 'Email (will not be published)', 'required' => true] ); $this->getElement('email')->getDecorator('label')->setOption('escape', false); } $this->addElement('textarea', 'content', ['label' => 'Comment', 'required' => true]); return $this; } protected function _initButtons() { if (!$this->_hasButtons) { return $this; } $this->addElement( 'submit', 'btnSubmit', [ 'label' => 'Submit Comment', 'attribs' => ['class' => 'btn'], ] ); return $this; } }