Simplify and clarify Forms and FormViews #54
@ -10,7 +10,7 @@ class Form
 | 
			
		||||
{
 | 
			
		||||
	public $request_method;
 | 
			
		||||
	public $request_url;
 | 
			
		||||
	public $content_above;
 | 
			
		||||
	public $before_fields;
 | 
			
		||||
	public $buttons_extra;
 | 
			
		||||
	private $fields = [];
 | 
			
		||||
	private $data = [];
 | 
			
		||||
@ -25,7 +25,7 @@ class Form
 | 
			
		||||
		$this->request_url = !empty($options['request_url']) ? $options['request_url'] : BASEURL;
 | 
			
		||||
		$this->fields = !empty($options['fields']) ? $options['fields'] : [];
 | 
			
		||||
		$this->buttons_extra = !empty($options['buttons_extra']) ? $options['buttons_extra'] : null;
 | 
			
		||||
		$this->content_above = !empty($options['content_above']) ? $options['content_above'] : null;
 | 
			
		||||
		$this->before_fields = !empty($options['before_fields']) ? $options['before_fields'] : null;
 | 
			
		||||
		$this->submit_caption = !empty($options['submit_caption']) ? $options['submit_caption'] : 'Save information';
 | 
			
		||||
		$this->trim_inputs = !empty($options['trim_inputs']);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -31,8 +31,8 @@ class FormView extends SubTemplate
 | 
			
		||||
		echo '
 | 
			
		||||
			<form action="', $this->form->request_url, '" method="', $this->form->request_method, '" enctype="multipart/form-data">';
 | 
			
		||||
 | 
			
		||||
		if (isset($this->form->content_above))
 | 
			
		||||
			echo $this->form->content_above;
 | 
			
		||||
		if (isset($this->form->before_fields))
 | 
			
		||||
			echo $this->form->before_fields;
 | 
			
		||||
 | 
			
		||||
		$this->missing = $this->form->getMissing();
 | 
			
		||||
		$this->data = $this->form->getData();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user