Re: [fw-general] zend registry problem

2008-08-11 Thread Ahmed Abdel-Aliem
Thanks a lot  :)
i am using Zend_Session to do the job, i dunno how i forgot this :D
thanks a lot for those who helped
i really appreciate it.

On Fri, Aug 8, 2008 at 1:13 PM, Carlos Medina <[EMAIL PROTECTED]>wrote:

> Ahmed Abdel-Aliem schrieb:
> > Dear All,
> >
> > i have a problem setting a value in Zend_Registry and retrieving it back
> in
> > another page
> >
> > *here is the scenario, when a user log in i set his last login from the
> > database in a variable :*
> >
> >
> > Zend_Registry::getInstance();
> > Zend_Registry::set('user_last_login',
> > $user_row[user_last_login]);
> >
> >
> > *and in the page he is redirected to i try to retrieve this variable like
> > this :*
> >
> >
> > Zend_Registry::getInstance();
> > echo Zend_Registry::get('user_last_login');
> >
> >
> > *the page return the following error :*
> >
> > The following error occurred:
> > exception 'Zend_Exception' with message 'No entry is registered for key
> > 'user_last_login'' in
> > /Library/WebServer/Documents/cha/library/Zend/Registry.php:145 Stack
> trace:
> > #0
> >
> /Library/WebServer/Documents/cha/application/admin/controllers/IndexController.php(46):
> > Zend_Registry::get('user_last_login') #1
> > /Library/WebServer/Documents/cha/library/Zend/Controller/Action.php(502):
> > IndexController->indexAction() #2
> >
> /Library/WebServer/Documents/cha/library/Zend/Controller/Dispatcher/Standard.php(293):
> > Zend_Controller_Action->dispatch('indexAction') #3
> > /Library/WebServer/Documents/cha/library/Zend/Controller/Front.php(919):
> >
> Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
> > Object(Zend_Controller_Response_Http)) #4
> > /Library/WebServer/Documents/cha/admin/index.php(53):
> > Zend_Controller_Front->dispatch() #5 {main}
> >
> > i dunno why it is not working while i can easily retrieve any variable i
> set
> > in the registry in my bootstrap
> >
> >
> > here is how i deal with the registry in my bootstrap
> >
> > $registery = Zend_Registry::getInstance();
> > Zend_Registry::set('connection', $config->database);
> > Zend_Registry::set('pageLimit', $dataConfig->pages->limit);
> > Zend_Registry::set('truepath', '/cha/application/admin/');
> > Zend_Registry::set('urlpath', 
> > 'http://localhost/cha/admin/'
> );
> >
> > can anyone give me a hand in this please ?
> >
> > thanks in advance.
> > *
> > Regards,
> > Ahmed Abdel-Aliem
> > Aroma Designs & Solutions
> > www.GraphicAroma.com
> > www.AromaCreatives.com*
> >
> > Acting by Reacting : By not printing this e-mail I help protect the
> > environment.
> >
> >
> Hi,
> i Use the Zend Registry with
> Zend_Registry::set( $strRegistryName, $objRegistryObject ); // use
> variables on the setRegistry Method anyware.
> and i get the Data with
> Zend_Registry::get( 'registry' );
>
> Regards
>
> Carlos
>

*
Regards,
Ahmed Abdel-Aliem

Aroma Designs & Solutions
www.GraphicAroma.com
www.AromaCreatives.com

Acting by Reacting : By not printing this e-mail I help protect the
environment.*


Re: [fw-general] zend registry problem

2008-08-08 Thread Carlos Medina
Ahmed Abdel-Aliem schrieb:
> Dear All,
>
> i have a problem setting a value in Zend_Registry and retrieving it back in
> another page
>
> *here is the scenario, when a user log in i set his last login from the
> database in a variable :*
>
>
> Zend_Registry::getInstance();
> Zend_Registry::set('user_last_login',
> $user_row[user_last_login]);
>
>
> *and in the page he is redirected to i try to retrieve this variable like
> this :*
>
>
> Zend_Registry::getInstance();
> echo Zend_Registry::get('user_last_login');
>
>
> *the page return the following error :*
>
> The following error occurred:
> exception 'Zend_Exception' with message 'No entry is registered for key
> 'user_last_login'' in
> /Library/WebServer/Documents/cha/library/Zend/Registry.php:145 Stack trace:
> #0
> /Library/WebServer/Documents/cha/application/admin/controllers/IndexController.php(46):
> Zend_Registry::get('user_last_login') #1
> /Library/WebServer/Documents/cha/library/Zend/Controller/Action.php(502):
> IndexController->indexAction() #2
> /Library/WebServer/Documents/cha/library/Zend/Controller/Dispatcher/Standard.php(293):
> Zend_Controller_Action->dispatch('indexAction') #3
> /Library/WebServer/Documents/cha/library/Zend/Controller/Front.php(919):
> Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
> Object(Zend_Controller_Response_Http)) #4
> /Library/WebServer/Documents/cha/admin/index.php(53):
> Zend_Controller_Front->dispatch() #5 {main}
>
> i dunno why it is not working while i can easily retrieve any variable i set
> in the registry in my bootstrap
>
>
> here is how i deal with the registry in my bootstrap
>
> $registery = Zend_Registry::getInstance();
> Zend_Registry::set('connection', $config->database);
> Zend_Registry::set('pageLimit', $dataConfig->pages->limit);
> Zend_Registry::set('truepath', '/cha/application/admin/');
> Zend_Registry::set('urlpath', 'http://localhost/cha/admin/');
>
> can anyone give me a hand in this please ?
>
> thanks in advance.
> *
> Regards,
> Ahmed Abdel-Aliem
> Aroma Designs & Solutions
> www.GraphicAroma.com
> www.AromaCreatives.com*
>
> Acting by Reacting : By not printing this e-mail I help protect the
> environment.
>
>   
Hi,
i Use the Zend Registry with
Zend_Registry::set( $strRegistryName, $objRegistryObject ); // use
variables on the setRegistry Method anyware.
and i get the Data with
Zend_Registry::get( 'registry' );

Regards

Carlos


Re: [fw-general] zend registry problem

2008-08-08 Thread Carlton Gibson


On 8 Aug 2008, at 10:34, Ahmed Abdel-Aliem wrote:

here is the scenario, when a user log in i set his last login from  
the database in a variable :



Zend_Registry::getInstance();
Zend_Registry::set('user_last_login', $user_row 
[user_last_login]);



and in the page he is redirected to i try to retrieve this variable  
like this :



Zend_Registry::getInstance();
echo Zend_Registry::get('user_last_login');



Hi,

If you are using a **redirect** then you are starting a new request.  
You would need to store the last login data in a session (rather than  
the registry) in order to access it.


Try:

$session = new Zend_Session_Namespace('login');
$session->user_last_login = $user_row[user_last_login];


And

$session = new Zend_Session_Namespace('login');
echo session->user_last_login;

Regards,
Carlton


Re: [fw-general] zend registry problem

2008-08-08 Thread David Goodwin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


> can anyone give me a hand in this please ?
> 

You need to persist your Zend_Registry instance in a session, or use
Zend_Session instead of Zend_Registry for storing the last login data.

David.

- --
 David Goodwin  Pale Purple Limited
 Office: 0845 0046746   Mobile: 07792380669
 http://www.palepurple.co.ukCompany No: 5580814
 'Business Web Application Development and Training in PHP'
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFInBXw/ISo3RF5V6YRAploAKCzRHvGMreFufmvwJquObSUDBu2LwCgy2Yk
fgaMiQTmZqrewET7bz4ALPo=
=FrRE
-END PGP SIGNATURE-


[fw-general] zend registry problem

2008-08-08 Thread Ahmed Abdel-Aliem
Dear All,

i have a problem setting a value in Zend_Registry and retrieving it back in
another page

*here is the scenario, when a user log in i set his last login from the
database in a variable :*


Zend_Registry::getInstance();
Zend_Registry::set('user_last_login',
$user_row[user_last_login]);


*and in the page he is redirected to i try to retrieve this variable like
this :*


Zend_Registry::getInstance();
echo Zend_Registry::get('user_last_login');


*the page return the following error :*

The following error occurred:
exception 'Zend_Exception' with message 'No entry is registered for key
'user_last_login'' in
/Library/WebServer/Documents/cha/library/Zend/Registry.php:145 Stack trace:
#0
/Library/WebServer/Documents/cha/application/admin/controllers/IndexController.php(46):
Zend_Registry::get('user_last_login') #1
/Library/WebServer/Documents/cha/library/Zend/Controller/Action.php(502):
IndexController->indexAction() #2
/Library/WebServer/Documents/cha/library/Zend/Controller/Dispatcher/Standard.php(293):
Zend_Controller_Action->dispatch('indexAction') #3
/Library/WebServer/Documents/cha/library/Zend/Controller/Front.php(919):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http)) #4
/Library/WebServer/Documents/cha/admin/index.php(53):
Zend_Controller_Front->dispatch() #5 {main}

i dunno why it is not working while i can easily retrieve any variable i set
in the registry in my bootstrap


here is how i deal with the registry in my bootstrap

$registery = Zend_Registry::getInstance();
Zend_Registry::set('connection', $config->database);
Zend_Registry::set('pageLimit', $dataConfig->pages->limit);
Zend_Registry::set('truepath', '/cha/application/admin/');
Zend_Registry::set('urlpath', 'http://localhost/cha/admin/');

can anyone give me a hand in this please ?

thanks in advance.
*
Regards,
Ahmed Abdel-Aliem
Aroma Designs & Solutions
www.GraphicAroma.com
www.AromaCreatives.com*

Acting by Reacting : By not printing this e-mail I help protect the
environment.