View Single Post
  #3 (permalink)  
Old 08-07-2007, 12:54 AM
Elemental's Avatar
Elemental Elemental is offline
Senior Member
 
Join Date: Jul 2007
Posts: 122
Default

I use them in the same controller. So basically its a identity verification thingy.

In one action I get the username and password, and create a hash that is emailed to the user. I need to store the username/password/userid (a key in the table)/hash.

I think I figured out I was doing this all wrong for my purposes. I've since put it in the session namespace and all is working out fine now. However, I'd still like to find out why it wasn't working as I may need to register arrays in the future.

so,

class myController extends Zend_Controller_Action () {
public function startAction () {
$params = $this->_request->getParams('post');
$regInfo = array (
'id' = params['id'],
'uname' = params['username'],
'pass' = params['password'],
'vcode' = null,
);
$regInfo['vcode'] = md5($reginfo['id'] . $reginfo['password']);
//now I need to store this in the registry so I can refer to it later
Zend_Registry::set('regInfo', $regInfo);

//this works
$test = Zend_Registry::get('regInfo');
}

public function stopAction () {
//this doesn't
$test = Zend_Registry::get('regInfo');
}
}


stopAction throws an exception saying that there is no registered key 'regInfo'

Now, that's not how I am doing my authentication stuff anymore so its not a pressing issue. However, I would like to be set arrays to the registry in one action and recall them in another action within the same controller. Maybe I am not understanding how the registry handles non-objects?

Thanks for the reply and sorry for my horrid spelling... made me cringe to read it again, lol.
Reply With Quote