Today I learned from Zend Framework.
// Grabs the requested URI from the server and stores it in a hidden field
$this->addElement(‘hidden’, ‘referrer’, array(‘value’ => $_SERVER[‘REQUEST_URI’]));
Then after you complete authentication, send them to the referring URI if($form->getValue(‘referrer’)) $this->_redirect($form->getValue(‘referrer’)); $this->_redirect(‘index/index’);
This one is easy. You want to throw an error message with some meaning. throw new Zend_Exception(‘This is the error message’);
You want to save some data in a session variable so you can access it other places in application. So in the
Bootstrap.php file you would place
To set the variable you would use $ns = new Zend_Session_Namespace(‘hello’); $ns->domain = “Hello World”; By using the namespace “hello” or whatever you want, then you can keep your variables separate from another part of the applicate that just might happen to name it’s variable “domain” as well.
To retrieve this fun filled variable. $ns = new Zend_Session_Namespace(‘hello’); print $ns->domain;
Did this help you out? It took me a few days to piece together all this information together, I hope this saves you some time (who knows, maybe the future me will be thankful I wrote this down). Let me know your thoughts. firstname.lastname@example.org