[eluser]Jay Turley[/eluser]
I don't know if this is due to my CI noobness, but just in case, I'm going to post it here.
In my controller, I have the following:
Code:
function index() {
$this->load->helper('form','url');
$this->load->view('user_form');
}
When I create the view, the following code breaks. By this I mean that the rendered html source terminates with the
submit tag. There is nothing following it, no anchor, no html closing tag, no nuthin'!
Code:
$attributes = array('name' => 'new_user_form', 'id' => 'new_user_form');
echo form_open('user/create', $attributes);
echo form_label('Username', 'username');
$inputData = array(
'name' => 'username',
'id' => 'username',
'maxlength' => '20',
'size' => '20',
);
echo form_input($inputData).'<br />';
echo form_label('Password', 'password');
$inputData = array(
'name' => 'password',
'id' => 'password',
'maxlength' => '20',
'size' => '20',
);
echo form_password($inputData).'<br />';
echo form_submit('addnewuser', 'Create Account');
// THIS IS WHERE THE CODE BREAKS!
echo anchor('', 'Cancel');
echo form_close();
After experimenting, it appears the only thing that fixes this issue is to load the helpers separately. With no change to the code at all, suddenly everything works.
Code:
function index() {
$this->load->helper('form');
$this->load->helper('url');
$this->load->view('user_form');
}
I searched the forum, but found no reference to this.
Thanks!