Simplify and clarify Forms and FormViews #54
@ -68,6 +68,7 @@ class FormView extends SubTemplate
 | 
			
		||||
				<div class="row mb-2">';
 | 
			
		||||
 | 
			
		||||
		if ($field['type'] !== 'checkbox')
 | 
			
		||||
		{
 | 
			
		||||
			if (isset($field['label']))
 | 
			
		||||
				echo '
 | 
			
		||||
					<label class="col-sm-2 col-form-label" for="', $field_id, '"', in_array($field_id, $this->missing) ? ' style="color: red"' : '', '>', $field['label'], ':</label>
 | 
			
		||||
@ -75,6 +76,7 @@ class FormView extends SubTemplate
 | 
			
		||||
			else
 | 
			
		||||
				echo '
 | 
			
		||||
					<div class="offset-sm-2 ', isset($field['class']) ? $field['class'] : 'col-sm-6', '">';
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		switch ($field['type'])
 | 
			
		||||
		{
 | 
			
		||||
@ -122,6 +124,10 @@ class FormView extends SubTemplate
 | 
			
		||||
 | 
			
		||||
		echo '
 | 
			
		||||
				</div>';
 | 
			
		||||
 | 
			
		||||
		if (isset($field['after_html']))
 | 
			
		||||
			echo '
 | 
			
		||||
				', $field['after_html'];
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	private function renderCaptcha($field_id, array $field)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user