Welcome Guest, Not a member yet? Register   Sign In
Troubles with routing
#4

[eluser]n0xie[/eluser]
What do you mean by destination page?

If you mean the page your form submits to, then that should be to a controller. In that case you wouldn't use relative or absolute paths, you would use the URL. Something like http://www.mysite.tld/mycontroller/funct...tosubmitto.

If you mean you want to include a form then the usual way to go about it, is to load the view in the controller like this:
Code:
/* controller */
$pagecontent['form1'] = $this->load->view('myform',$data,TRUE);
Now the output is stored in a string or object instead of outputted to the browser. You can now pass it to your (master) template like this:

Code:
/* controller */
$this->load->view('mytemplate',$pagecontent);

Inside your template_view you can then output it like you would any other string/object:
Code:
/* my template_view */
$this->load->view('header');

echo $form1;

$this->load->view('footer');
This way, if you ever change the layout of your form, it will automatically be adjusted for any page you use the same form...

Hope that helps...


Messages In This Thread
Troubles with routing - by El Forum - 04-07-2009, 05:36 AM
Troubles with routing - by El Forum - 04-07-2009, 05:51 AM
Troubles with routing - by El Forum - 04-07-2009, 06:17 AM
Troubles with routing - by El Forum - 04-07-2009, 06:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB