Example #1
0
 /**
  * @return string
  */
 public function buildSecurity()
 {
     if ($this->security) {
         $formName = new Hidden($this, Security::FORM_NAME, array('value' => $this->name));
         $token = new SecurityToken($this, Security::TOKEN);
         $timestamp = new Hidden($this, Security::TIMESTAMP, array('value' => Security::getTimestamp()));
         return $token . $timestamp . $formName;
     } else {
         return '';
     }
 }
Example #2
0
 public function buildOpenTag()
 {
     $this->attributes['value'] = Security::generateToken($this->form->name, $this->form->getHiddenValues(), $this->form->action);
     return parent::buildOpenTag();
 }