[eluser]jblack199[/eluser]
I've been fiddling with codeignigter for a while after deciding that smarty template engine is rather bloated.
I am currently working on a system and am starting with the administration panel, I am however having issues getting my custom helper to load.
file name: valid_admin_helper.php located in: application/helpers/ directory
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Qweeri
*
* Helper object to allow the admin to check all admin specifications and if logged in.
*
* @package My stuff
* @subpackage is_admin
* @copyright Copyright (c) 2011, Justin B.
* @since Version 1.0
* @filesource
*/
/**
* valid_admin
*
* Lets you determine whether the selected user is a valid admin or not
*
*/
function valid_admin()
{
}
function login_admin($params)
{
}
function logout_admin() {
}
/* End of file valid_admin (/
/* Location: ./application/helpers/valid_admin_helper.php */
Nothing too big about that -- haven't added in any of the code for the functions yet obviously. I've added this into my autoload.php like:
Code:
$autoload['helper'] = array('valid_admin', 'url');
problem is, when i visit the actual site I get:
Fatal error: Call to undefined method Welcome::valid_admin() in /home/thecodes/public_html/mystuff/application/controllers/adm/welcome.php on line 23
which here is the code for the welcome.php
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
$in = $this->valid_admin();
if ($in == '0' || $in == '')
{
redirect('adm/login/', 'refresh');
}
}
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
Any help figuring this out would be greatly appreciated. Thanks in advance!