How to transfer data from Controller to View Magento ?

Hello Developer,

today we are Learn How to transfer data from Controller to View Magento.

Magento have a inbuilt function to pass array from controller to Phtml file. You can Pass any Data Like a Array String using this Method.

First You have to Store a Value in one variable.

$cars = array("Volvo", "BMW", "Toyota");

Its You array You want to pass a result in phtml file from controller Magento. then You can use Mage::register method to pass array in controller.

Now Set this value in Your Controller.


In this line the cars_data name is only name to access the data in phtml file. You can writer here any name as per Your Choice.

Now Get Data in Your View Phtml File.

$car_value = Mage::registry('cars_data');

Now You Can Store the data in a Variable and you can Check the getting data using var_dump($car_value );



10 thoughts on “How to transfer data from Controller to View Magento ?

  1. Hey webmaster
    When you write some blogs and share with us,that is a hard work for you but share makes you happly right?
    yes I am a blogger too,and I wanna share with you my method to make some extra cash,not too much
    maybe $100 a day,but when you keep up the work,the cash will come in much and more.more info you can checkout my blog.
    good luck and cheers!

  2. Right here is the right site for anyone who wants to find out about this topic.
    You know a whole lot its almost hard to argue with you (not that I actually will need to…HaHa).
    You certainly put a brand new spin on a subject that’s been written about for many years.
    Wonderful stuff, just great!

Leave a Reply

Your email address will not be published. Required fields are marked *