Пример #1
0
 /**
  * Builds a string representation of the form accessor.
  * This string is used as a part of the key for the layout cache.
  *
  * @param string          $prefix  A string that can be used as the form identifier
  * @param FormAction|null $action  The submit action of the form
  * @param string|null     $method  The submit method of the form
  * @param string|null     $enctype The encryption type of the form
  *
  * @return string
  */
 protected function buildHash($prefix, FormAction $action = null, $method = null, $enctype = null)
 {
     $result = $prefix;
     if (null !== $action && !$action->isEmpty()) {
         $result .= ';action_' . $action->toString();
     }
     if (!empty($method)) {
         $result .= ';method:' . $method;
     }
     if (!empty($enctype)) {
         $result .= ';enctype:' . $enctype;
     }
     return $result;
 }