简体   繁体   中英

Magento Access functions from a module directly in another module's phtml file

My setup

I have two modules installed:

  • one takes an id and builds a product collection from this using the id t o lookup an attribute-value pair ( mod1 )
  • The other offers a way of narrowing a search down ( mod2 )

The true url I am on is /mod1/page/view/id/<id#>

Desired outcome

To be able to pass the attribute-value as a hidden field to the second module

Question

How do I access the object and functions from mod1 when I'm in the layout file for mod2 ?

If more information is required, please let me know.

The way the module needed to be loaded was as follows:

Mage::registry('mod1_type');

Where in the controller this had been set:

$mod1Type = Mage::getModel('mod1/type')->setStoreId(Mage::app()->getStore()->getId())->load($mod1TypeId);

Mage::register('mod1_type', $mod1Type);

Then I could use the defined methods normally.

This may be an overly specific issue, should I just delete the question?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM