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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.