Example #1
0
 /**
  * Create an input element.
  * @param string $type Type.
  * @param string $field Field name.
  * @param string|string[] $attributes Attributes, see
  * {@see Html::readAttributes}.
  * @return string HTML element.
  */
 private function inputElement($type, $field, $attributes)
 {
     $attributes = Html::mergeAttributes(array('type' => $type, 'name' => $this->name($field), 'id' => $this->id($field), 'value' => $type != 'password' ? $this->value($field) : null, 'data-error' => $this->error($field, null)), $attributes);
     return $this->Html->create('input', $attributes)->toString();
 }