0

i want to send a variable in the magento observer in a custom module to , a template on the admin pages ( phtml , template ) , any help would be welcome .

1
  • Without context, this question does not make much sense. Please explain, what you are actually trying to do. Also: What kind of observer? Which template do you want to change and how? Sep 20 '16 at 20:12
1

I agree totally with fschmengler.

But to pass something to the frontend you need the Block, like this:

Mage::app()->getLayout()->getBlock('BLOCK_NAME___')->setYourVariable('WOHO!');

Then you can access it in the template with

$this->getYourVariable();
0
1

You can use magento registry for that

for adding data to registory

Mage::register('my_data', $mydata);

and getting data from registry where you want to use

print_r(Mage::registry('my_data'));

unset data from registry

Mage::unregister('my_data');

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