$value) { if(is_bool($value)) { $value = ($value) ? 'true' : 'false'; } $validation .= 'data-parsley-'.$rule.'="'.$value.'"'; } } return $validation; } protected static function renderLabel($block) { $html = ''; if( isset($block['params']['label_within']) && $block['params']['label_within'] ) { return $html; } if(isset($block['params']['label']) && strlen(trim($block['params']['label'])) > 0) { $html .= ''; } return $html; } protected static function renderInputPlaceholder($block) { $html = ''; // if the label is displayed as a placeholder, if( isset($block['params']['label_within']) && $block['params']['label_within'] ) { // display only label $html .= ' placeholder="'; $html .= static::getFieldLabel($block); // add an asterisk if it's a required field if(isset($block['params']['required']) && $block['params']['required']) { $html .= ' *'; } $html .= '" '; } return $html; } // return field name depending on block data protected static function getFieldName($block = array()) { return $block['id']; } protected static function getFieldLabel($block = array()) { return (isset($block['params']['label']) && strlen(trim($block['params']['label'])) > 0) ? trim($block['params']['label']) : ''; } protected static function getFieldValue($block = array()) { return (isset($block['params']['value']) && strlen(trim($block['params']['value'])) > 0) ? trim($block['params']['value']) : ''; } }