Welcome Guest, Not a member yet? Register   Sign In
library class in my application
#3

[eluser]andygo[/eluser]
Thanks InsiteFX, much appreciated

I created a MY_Controller in application/core and extended it in the controller.
I referenced my library file and now my library has access to the callback function in the MY_Controller..


In case this helps anyone here is my code...
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Controller extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->library('form_data_lib');
}

public function username_check($str)
{
  if ($str == 'test')
  {
   $this->form_validation->set_message('username_check', 'The %s field can not be the word "test"');
   return FALSE;
  }
  else
  {
   return TRUE;
  }
}


}
// END Class

/* End of file .php */
/* Location: .php */


Messages In This Thread
library class in my application - by El Forum - 06-28-2012, 05:12 AM
library class in my application - by El Forum - 06-28-2012, 01:09 PM
library class in my application - by El Forum - 06-29-2012, 04:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB