Example #1
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     // create form
     $this->frm = new FrontendForm('commentsForm');
     $this->frm->setAction($this->frm->getAction() . '#' . FL::act('Comment'));
     // init vars
     $author = CommonCookie::exists('comment_author') ? CommonCookie::get('comment_author') : null;
     $email = CommonCookie::exists('comment_email') && \SpoonFilter::isEmail(CommonCookie::get('comment_email')) ? CommonCookie::get('comment_email') : null;
     $website = CommonCookie::exists('comment_website') && \SpoonFilter::isURL(CommonCookie::get('comment_website')) ? CommonCookie::get('comment_website') : 'http://';
     // create elements
     $this->frm->addText('author', $author)->setAttributes(array('required' => null));
     $this->frm->addText('email', $email)->setAttributes(array('required' => null, 'type' => 'email'));
     $this->frm->addText('website', $website, null);
     $this->frm->addTextarea('message')->setAttributes(array('required' => null));
 }