Welcome Guest, Not a member yet? Register   Sign In
really unusual error!
#1

[eluser]tom.waters[/eluser]
I basiclly copied the following code out of the user guide and tried to run it but no matter what I do I get the following error.

An Error Was Encountered

Unable to load the requested file: .php

function profile()
{
$this->load->library('form'); // first of all we have to load the library

$this->form // then we fill the form with elements
->open('login')
->text('username', 'Your Username', 'trim|alpha_numeric|max_length[30]|xss_clean')
->pass('password', 'Your Password', 'trim|alpha_numeric|max_length[20]|xss_clean')
->indent(150)
->checkbox('loggedin', 'yes', 'I want to stay logged-in')
->submit()
->reset()
->onsuccess('redirect', 'member/success');

$data['topnav'] = 'homenav';
$data['main_content'] = $this->form->get(); // this returns the validated form as a string
$data['errors'] = $this->form->errors; // this returns validation errors as a string

$this->load->view('template', $data);
}

Any ideas?
#2

[eluser]J.Frederic[/eluser]
Its look to be aroud $this->load->view(‘template’, $data);

do you have template.php in your views folder?
#3

[eluser]tom.waters[/eluser]
Yes, and it works with all other data array's just not the form array?
#4

[eluser]2think[/eluser]
You said you copied it out of the userguide, that's not the CI userguide but mac igniter's Formlib right? So make sure you have the formlib library file in the right place (in your application/libraries folder)

Its pretty late here but I think it has something to do with that, read more here http://ellislab.com/forums/viewthread/107861/

The official CodeIgniter form usage can be found here http://ellislab.com/codeigniter/user-gui...elper.html and you'll need the Form Validation class also loaded to do official or standard CI forms.

Final quick tip seeing as you seem to be new, when posting to Ignited Code, its for third-party libraries, so if you post in the thread of whatever library or at least use it in the title/subject, you will likely get faster and better quality help.

Hope some of this helps




Theme © iAndrew 2016 - Forum software by © MyBB