'Pending', 'approved' => 'Approved', 'disapproved' => 'Disapproved', 'spam' => 'Spam', ]; protected function _initElements() { $this->addElement('hidden', 'idPost'); $this->addElement( 'select', 'status', [ 'label' => 'Status', 'required' => true, 'multiOptions' => self::$commentStatuses, 'value' => 'pending', ] ); $this->addElement('text', 'author', ['label' => 'Author', 'required' => true]); $this->addElement('email', 'email', ['label' => 'Email']); $this->addElement( 'date', 'postingDate', ['label' => 'Post Date', 'required' => true, 'value' => date('Y-m-d')] ); $this->addElement( 'time', 'postingTime', ['label' => 'Post Time', 'required' => true, 'value' => date('H:i:s')] ); $this->addElement('textarea', 'content', ['label' => 'Comment', 'required' => true]); $this->addElement( 'text', 'ipAddress', ['label' => 'IP Address', 'filters' => ['StringTrim'], 'validators' => ['Ip']] ); $this->addElement('text', 'userAgent', ['label' => 'User Agent']); $this->addElement('text', 'referer', ['label' => 'Referring URL']); return $this; } }