Welcome Guest, Not a member yet? Register   Sign In
Calling a model from a view?
#1

[eluser]eboxhead[/eluser]
Im trying to create a password encryption function that can be called when needed.

I can get it to work fine in a view, but once i put it in a model i just errors and Im not sure why.


Encryption
Code:
<?


class Encrypt extends Model() {

function Encrypt() {
    
   parent::Model;
}

function encryptpassword($random, $password) {
    $secure=sha1($random.$password);
    return $secure;

}

The View (quite vanilla)
Code:
<html>
    <head>

    </head>
    <body>
        <?php

        $random = "sddkldksdklds";
        $password = "password";

        $this->load->model('Encrypt');
        $this->Encrypt->passwordencrypt($random, $password);

        echo $secure;

        ?>
    </body>
</html>

Im sure its somethign simple, but what am i missing?


Messages In This Thread
Calling a model from a view? - by El Forum - 03-13-2010, 10:20 PM
Calling a model from a view? - by El Forum - 03-13-2010, 10:21 PM
Calling a model from a view? - by El Forum - 03-13-2010, 10:26 PM
Calling a model from a view? - by El Forum - 03-13-2010, 10:28 PM
Calling a model from a view? - by El Forum - 03-13-2010, 10:57 PM
Calling a model from a view? - by El Forum - 03-14-2010, 01:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB