定义Magento类名称的字符串的名称(Name for the Strings that Define Magento Class Names)

编程入门 行业动态 更新时间:2024-10-04 21:17:58
定义Magento类名称的字符串的名称(Name for the Strings that Define Magento Class Names)

Magento使用工厂模式来实例化类中的对象

$model = Mage::getModel('catalog/product'); //Mage_Catalog_Model_Product by default $helper = Mage::helper('catalog/data'); //Mage_Catalog_Helper_Data by default

这些字符串被扩展为类名,系统可以被配置为替换默认值。

什么是或应该调用这些字符串? 我一直在滥用术语URI(有时用“类似URI”这个短语来缓和这种滥用),但这并不正确。 “Class Name”看起来不正确,因为它很容易引起混淆(你是在谈论工厂类名称还是实际的PHP类名称?)

任何人都有权对此进行任何刺杀?

Magento uses a factory pattern for instantiating objects from classes

$model = Mage::getModel('catalog/product'); //Mage_Catalog_Model_Product by default $helper = Mage::helper('catalog/data'); //Mage_Catalog_Helper_Data by default

These strings are expanded into classnames, and the System can be configured to replace the default values.

What are, or should, these strings be called? I've been abusing the term URI (sometimes tempering the abuse with the phrase "URI-like"), but that's not really right. "Class Name" doesn't seem right either, as it could easily cause confusion (Are you talking about the factory class name, or the actual PHP class name?)

Anyone have any stabs at authority on this?

最满意答案

这个字符串被称为类(模型,块,助手 - 依赖于使用上下文)别名。 别名命名规则是: 组/实体

每个模块可以定义自己的组或为现有组定义重写。

This string is called class (model, block, helper - depends from usage context) alias. Alias naming rule is: group/entity.

Each module can define own group or define rewrites for existing one.

更多推荐

本文发布于:2023-08-04 19:47:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1422276.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:名称   字符串   定义   Magento   Names

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!