view shared_view/includes/dojo/form.tt @ 11:573272ec604b

almost comlete doxygen library
author sergey
date Thu, 15 May 2014 18:24:02 +0400
parents
children
line wrap: on
line source

[%
	BLOCK INIT;
		document.dojo.modules.push("dijit/form/Form");
	END;
	
	FormResult = import('IMPL::Web::View::FormResult');
	Metadata = import('IMPL::Web::View::Metadata::FormMeta');
	
	UNLESS is(model,FormResult);
		THROW form 'The form result is required';
	END;
	
	# defaults
	content = layout.content || 'form/group';
	enctype = enctype || 'application/x-www-form-urlencoded';
	method = method || 'POST';
	formMeta = Metadata.GetMetadataForModel(model.node, errors = model.errors, nodes = [model.node]);
 %]
<form data-dojo-type="dijit/form/Form" class="form-control" method="$method" [% IF action %]action="$action" [% END %] enctype="$enctype">
	[% display_model(formMeta, content, layout.args) %]
</form>