开发者

Magento- How to passing data between model and controller

开发者 https://www.devze.com 2023-04-13 07:22 出处:网络
Thanks for previous replies, I am new to magento framework. can anyone guide me how to ge开发者_高级运维t the return values from model to controller. in simple i want to return the values from model

Thanks for previous replies,

I am new to magento framework. can anyone guide me how to ge开发者_高级运维t the return values from model to controller. in simple i want to return the values from model folder to controller action.


I think this will do what you want

 $collection = Mage::getModel('<module>/<module>')->getCollection();

<module> represents model name


In Magento, controller sets values on Models, then Blocks and templates reads them from the those Models. For example, we can set a string hello by using core/session model

Mage::getSingleton('core/session')->setHello('hello');

Then we can get this hello from a block or a template or anywhere else by

Mage::getSingleton('core/session')->getHello();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号