private function processAttributes($element, $attributes, $container = false)
{
/* generating the id on its own if not provided otherwise taken from the parameter provided */
if (isset($attributes['id'])) {
$html = $this->generate_element_id($element, $attributes['id']) . ' ';
} else {
$html = $this->generate_element_id($element) . ' ';
}
/* name attrbute according to multiple flag */
$multiple = isset($attributes['multiple']) && $attributes['multiple'] ? true : false;
$name = isset($attributes['name']) ? $attributes['name'] : $element;
$html .= $this->generate_element_name($element, $multiple, $name) . ' ';
/*
* list down all the classes provided along with the default class of rtForms.
* default class of rtForms will always be attached irrespective of the attributes provided.
*/
if (!$container) {
if (isset($attributes['class'])) {
$html .= $this->embedd_class($element, $attributes['class']);
} else {
$html .= $this->embedd_class($element);
}
}
if (isset($attributes['misc'])) {
$html .= ' ' . $this->embedd_misc_attributes($attributes['misc']);
}
$html .= $this->generate_element_value($element, $attributes);
return $html;
}