[eluser]FinalFrag[/eluser]
Yeah, but I'm not up to that level to write my own libraries and such.
About these libraries... I now have a bunch of custom functions that I use in my application. I put them in a file functions.php (and uploaded it in system/application/libraries), it looks like this:
Code:
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Functions {
function isLoggedIn() {
if ($this->session->userdata('username')) {
return true;
}
return false;
}
// more functions ...
}
?>
To be able to use these functions I have added the following line to my autoload.php:
Code:
$autoload['libraries'] = array('database', 'session', 'functions');
When I now need a function, I call it like this:
Code:
if (Functions::isLoggedIn()) {
// code here
}
Is this the right way to do it in CodeIgniter? Or am I doing it wrong?