更新时间:2023-11-30 10:31:16
您应该深入研究代码.使用getModel
,您可以获取位于Models
目录中的每个模块的每个类的实例.在catalog/product_option_a_b_c
表达式中,最合适的部分(catalog
)引用模块,第二部分引用catalog
模块的Models
目录中的Product/Option/A/B/C.php
文件.因此,如果要获取Mage_Sales_Model_Quote_Address
类的实例,则需要:Mage::getModel('sales/quote_address')
You should dig into code. Using getModel
you're able to get an instance of each class of each module which is located in Models
directories. In catalog/product_option_a_b_c
expression, the fitst part (catalog
) references to module and the second part references to Product/Option/A/B/C.php
file in the Models
directory of catalog
module. So if you want to get an instance of Mage_Sales_Model_Quote_Address
class, you need this: Mage::getModel('sales/quote_address')