magento2 观后思想记录

本文介绍了Magento2的架构特点,包括模型文件的功能、资源模型的作用、集合模型的应用、模型工厂对象的实例化过程、system.xml配置字段的可见性和获取方式、事件驱动架构的工作原理、索引监控机制以及插件拦截等特性。此外,还讨论了如何重写控制器和模块,以及Magento2中customer、product和category自定义属性的方法。
模型文件 包含整体数据库逻辑,它不执行sql查询
资源模型 从数据库获取信息 并执行SQL逻辑
集合模型 被认为是一个资源模型使我们能够筛选和获取集合表中的数据


模型工厂对象  当引用时magento自动创建


模型工厂对象来实例化模型对象




system.xml中配置的字段值 ,在Configuration里可以看到,可以通过help帮助文件 类构造并获得


事件驱动的架构


如何使用路由来重写控制器


索引原理:监控数据库某些表的变化,来抒写自己的逻辑,通过这些逻辑可以找到监控表的数据


Magento 2插件拦截,您可以修改类的行为,而不需要直接更改类


Magento2 customer ,product,category 都可以自定义属性




magento 还支持 必须 在某些模块之后 运行的模块
<module name="Mageplaza_Payment" setup_version="0.1.0">
        <sequence>
            <module name="Magento_Sales"/>
            <module name="Magento_Payment"/>
            <module name="Magento_Checkout"/>
            <module name="Magento_Directory" />
            <module name="Magento_Config" />
        </sequence>
    </module>


//
重写模块的 块,控制器,模型,助手 用 插件 和 Preference两种方法


但是,如果两个或更多个模块尝试重写相同的核心类,则Preference可能会导致不方便的冲突。
//


URL 重写

What this book covers Chapter 1, Installing Magento 2 on Apache and NGINX, is a totally different ballgame compared to Magento 1. Where Magento 1 could be installed through FTP or SSH, Magento 2 is installable only via the command-line interface for an experienced webmaster. Chapter 2, Magento 2 System Tools, explains how to install Magento 2 via the command shell. Magento released a new powerful tool to manage and install sample data, reindex your database, back up your site, or flush your caches, which are just a few of the options. Chapter 3, Enabling Performance in Magento 2, explains how to configure different types of caching options. In Magento 2, the Full Page Cache (FPC) can be handled by Varnish to give your store a performance boost. There are also external services that you can use as a cache. Chapter 4, Creating Catalogs and Categories, shows you one of the major elements of a Magento store before creating products. Creating the correct product type including attributes is an important step in setting up a Magento store. Chapter 5, Managing Your Store, covers setting up the correct tax rules, configuring an inventory, and creating customer groups. Chapter 6, Creating a Magento 2 Theme, discusses the Magento 2 blank theme and how to use the fallback to create seasonal variations. It also explains how the new theme is set up and where files are stored. Chapter 7, Creating Magento 2 Extensions – the Basics, contains the basic functions required to use extensions in a Magento 2 installation. It contains a brief introduction to new methods introduced in the Magento 2 framework and examples on how to create basic functions. Chapter 8, Creating Magento 2 Extensions – Advanced, explains how to use advanced features in extensions for Magento 2. It also includes how to add unit/functional tests as this is a new requirement for extensions listed on the new Magento
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值