Trong theme
bảng có một type
trường có 3 giá trị có thể: vật lý, ảo và dàn.
Khi nào nên sử dụng vật lý ảo và dàn dựng?
Khi tôi mở rộng chủ đề luma, chủ đề mới của tôi xuất hiện trong bảng chủ đề dưới dạng ảo. Nhưng có vẻ như loại này không cho phép ghi đè một số tệp và chỉ thay đổi loại chủ đề từ ảo sang vật lý, hãy để tôi mở rộng ví dụ Magento_Theme
gói.
vendor\magento\module-theme\Model\Theme\Registration.php
/** Allowed sequence relation by type, array(parent theme, child theme) * @var array */ protected $_allowedRelations = [ [ThemeInterface::TYPE_PHYSICAL, ThemeInterface::TYPE_VIRTUAL], [ThemeInterface::TYPE_VIRTUAL, ThemeInterface::TYPE_STAGING],]; /** Forbidden sequence relation by type ** @var array*/ protected $_forbiddenRelations = [[ThemeInterface::TYPE_VIRTUAL, ThemeInterface::TYPE_VIRTUAL],[ThemeInterface::TYPE_PHYSICAL, ThemeInterface::TYPE_STAGING],];
0: Physical - Magento Default Theme (Example: Magento Blank, Magento Luma, Magento 2 Backend) 1: Virtual - Custom Theme which is created by you (custom) which has parent as Default Theme (Example: My Theme) 2: Staging - ?