Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to a member function set_rules() on a non-object.
#1

[eluser]Rocky Mehta[/eluser]
Form_validation.php page is in the =>D:\www\vhosts\localhost\venue\system\libraries\Form_validation.php
Controller page
Code:
function main($venue_foodservice_as_id = 0)
{
  $this->load->library('Form_validation');
  $this->load->model('venue_foodservice_as_model');
  $data = $this->venue_foodservice_as_model->general();
  if ($this->input->post('save'))
  {
    $this->Form_validation->set_error_delimiters('<h2>', '</h2>');
    $rules['venue_foodservice_as_name']= "required";
    $this->Form_validation->set_rules($rules);
    $fields['venue_foodservice_as_name']     = 'My Username';
    $this->Form_validation->set_fields($fields);
    if ($this->input->post('venue_foodservice_as_id'))
    {
      $this->venue_foodservice_as_model->update_venue_foodservice_as();
      echo "Data Updated Successfully";
      redirect(HTTP_BASEURL.'index.php/venue_foodservice_as/update/');
  }
else
{
  if ($this->Form_validation->run() == FALSE)
  {
    $this->message = $this->validation->error_string;
  }else
   {
     $this->venue_foodservice_as_model->insert_venue_foodservice_as();
     echo "Data Inserted Successfully";
}
........
why this error occurred?
Form_validation No one function can access in my Current page why?
Please any one help me.
#2

[eluser]Rocky Mehta[/eluser]
Yes yes yes i m get it my error i write a 'Form_validataion' it's capital 'F' so it's not work remember always write function to call of start $this->form_validation->set_rules(); in small latters.




Theme © iAndrew 2016 - Forum software by © MyBB