Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Martin form notes.

Martin form notes

From MoodleDocs
$h = new HTMLFoo;
$v = new FormVal;

// direct print mode
print $h->h1();
print $h->input();

// build in mem
$h->form(array(id=>'zz',action=>, class=>));
$h->input('xx', array(id=>'myform_xx', type=>'text', required=>true, validation=>PARAM_INT));


if (isadmin()){
	$h->input(array(name=>'yy', type=>'text'));
	$v->optional('yy', PARAM_BAR);
}

if (randommaritnlanhoffrule()) {

}

// elements that you've registered with ID can be
// called and modified by id
$h->input(array(id=>'myform_xx', name=>'xx',type=>'something', content=>$somecontent));