All pastes #438819 Raw Edit

jcrawford

public text v1 · immutable
·published 2007-04-13 21:39 UTC
rendered paste body
	function view($step)
	{
		$this->load->library('forge');
		
		if($post = $this->forge->post_data)
		{
			// validate the post, if it is valid redirect if not just show the form filling in the form with the proper data
			if($this->forge->validate() === TRUE) redirect('/register/view/2/', 'refresh');
		}
		
		$conf['action'] = 'register/view/1';
		$conf['form_name'] = 'Registration: Step 1';
		
		$this->forge->initialize($conf);
		
		$data = array("type" => "text", "rules" => "trim|required|valid_email");

		$rules['email'] = "trim|required|valid_email";
		
		$this->forge->set_rules("email", $rules);
		$this->forge->add("email", $data);
		$this->forge->set("email", "onfocus", "showToolTip('email', 'email-address-info')");
		$this->forge->set("email", "onblur", "hideToolTip('email', 'email-address-info')");
		
		$form = $this->forge->build(true);
		
		$data = array('form' => $form);
		
		$this->main['sidebar'] = $this->load->view('common/fragments/sidebars/5LatestArticles', '', true);
		$this->main['content'] = $this->load->view('content/www/register/main', $data, true);
		$this->load->view('common/template', $this->main);
	}