I tried this code for creating registration form in the front end for user registration
<?php
class Register extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index()
{
$this->load->library('form_builder');
$this->load->model('register_model');
if (!empty($_POST))
{
if ($this->register_model->save($_POST))
{
$this->session->set_flashdata('success', TRUE);
redirect('register');
}
}
//register_model should extend the Base_module_model class (
http://www.getfuelcms.com/user_guide/libraries/base_module_model)
$fields = $this->register_model->form_fields();
$this->form_builder->set_fields($fields);
// will set the values of the fields if there is an error... must be after set_fields
$this->form_builder->set_field_values($_POST);
$this->form_builder->display_errors = TRUE;
// create a variable of $form to hold the rendered form output
$vars['form'] = $this->form_builder->render();
// use Fuel_page to render so it will grab all opt-in variables and do any necessary parsing
// create a view file called "register.php" that contains a place to merge in the $form variable
$page_init = array('location' => 'register');
$this->load->module_library(FUEL_FOLDER, 'fuel_page', $page_init);
$this->fuel_page->add_variables($vars);
$this->fuel_page->render();
}
}
But this error comes in register page.
An Error Was Encountered
Unable to load the requested class: fuel_page
What is the problem??
Comments
$this->fuel->pages->render('register, $vars);