0

I'm trying to pass some data from controller thru redirection to widget's .phtml file.

In sampleController.php:

Mage::register('demo_access', (isset($request['paragraphText']) ? 2 : 1));
Mage::log(Mage::registry('demo_access'));
$this->_redirect('watchdemo.html');

Works well, but after redirection to some cms page with some widget in sample.phtml code:

<?php var_dump($this->getNameInLayout()); ?>

returns null. Is it possible to do my job using registry or should I use session for my task?

1 Answer 1

1

Is it possible to do my job using registry or should I use session for my task?

Use the session. The registry is only valid per request (the data is nothing but a big PHP array) and _redirect() results in a new request from your browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.