[eluser]Unknown[/eluser]
I have a library 'system/application/library/Uac.php':
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Uac {
function create_account($user) {
$password = 1;
$this->_salt_password($password);
}
private function _salt_password($password) {
echo $this->config->item['encryption_key'];
}
}
I would like the method _salt_password to be able to access the $this->config object from the calling class, however I'm not too sure about what the best way to do this would be. It seems like I should be able to access this sort of stuff from within my library without having to pass them in as arguments but I'm not too sure how I'd go about doing it. If anyone could give me some guidance it would be much appreciated, I'm still trying to get my head around this whole OOP and MVC thing.
My apologies if this has been answered before - I did try searching but was unable to find anything.
The calling class is 'system/application/controllers/test.php':
Code:
<?php
class Test extends Controller {
function index() {
$this->load->library('uac');
$user = 'fs';
$this->uac->create_account($user);
}
}