[eluser]zlatiborac[/eluser]
OK, I made simple example of how I did this so here it is:
first I made controller named pages.php and I saved it in application/controllers folder. Here is the source:
Code:
<?php
class Pages extends Controller
{
function Pages ()
{
parent::Controller();
}
function index ()
{
$this->load->view("test");
}
}
// end of file
As you can see it only loads view file named test.
After this I made a file called test.php and saved it in my application/views folder. Here is the source from that file:
Code:
<?php
echo form_open('form');
echo form_input('name','Your name');
echo form_submit('submit', 'Send data');
echo form_close();
?>
Quite simple form, with only one input field and submit button. form_open is calling, if I am right, the file named form.php which resides in controllers folder so I made that file and here is it's source:
Code:
<?php
class Form extends Controller
{
function index ()
{
echo "SENT--------";
}
}
(I've intentionally left out closing ?> because it states in the manual that closing ?> can be left out)
Now when I click on submit button all I get is this form again (if I change "Your name" in something else and after I click on button I get the same form with "Your name" in input field; so it is reloading the same form again).
This is the way I did this and how I understood you reply... Am I correct?