08-09-2012, 09:48 AM
[eluser]alvaroeesti[/eluser]
Hello,
so,
What I want to do is this:
I have a code snippet that hashes passwords. I want to put it in a class, I will call the class from the Controller and will retrieve the returned value of the operation at the class and forward it to the Model.
1. First, from the controller I pass a value to the class of the library
2. The class of the library should return 2 values. Don't know how to write that. Something like this ?
3. And then the Controller should pick these values and forward them to the Model. I know how to pass them to the Model, but not quite how to receive them from the Class whose values it called.
Hello,
so,
What I want to do is this:
I have a code snippet that hashes passwords. I want to put it in a class, I will call the class from the Controller and will retrieve the returned value of the operation at the class and forward it to the Model.
1. First, from the controller I pass a value to the class of the library
Code:
$params = array('pass' => 'pass');
$this->load->library('myblowfish', $params);
2. The class of the library should return 2 values. Don't know how to write that. Something like this ?
Code:
return array($salt, $hashed_password);
3. And then the Controller should pick these values and forward them to the Model. I know how to pass them to the Model, but not quite how to receive them from the Class whose values it called.