ho-nl / magento2-templatehints
0.5.0
2023-07-27 07:48 UTC
Requires
- php: ~7.3||~7.4||^8.1
Replaces
- ho-nl/magento2-templatehints: 0.5.0
README
Ho_Templatehints 扩展默认的 Magento 模板提示。
- 通过肌肉记忆轻松访问
?ath=1
。 - 显示模板、抽象块(块)、容器和 UI 组件的提示。
- 无布局干扰:使用 CSS 边框而非其他 HTML 元素的边框,因此不会影响布局。
安装
composer require --dev honl/magento2-templatehints
php bin/magento module:enable Ho_Templatehints
php bin/magento setup:upgrade
开发安装(git 已启用)
composer require --dev honl/magento2-templatehints "dev-master"
php bin/magento module:enable Ho_Templatehints
php bin/magento setup:upgrade
配置 PHPStorm,允许远程调用
使用方法
- 将您的 Magento 2 安装设置为开发者模式(在生产模式下,请确保将您的 IP 地址添加到开发者客户端限制)。
- 将
?ath=1
添加到您的 URL 以激活。 - 在 Chrome/Firefox/Safari/
IE开发者工具中打开控制台。 - 按住 ⇧(shift)键
- 将鼠标悬停在要检查的元素上
- 哇!到处都是提示!
隐藏元素的提示
您无法显示隐藏元素的提示,为此可以使用 hint($0)
。
//Select an element in the Elements panel in your devtools, it is now available with $0 hint($0)
内部工作原理
该模块向布局元素的顶层元素添加一个额外的 HTML 属性。
致谢
灵感来源于 Aoe_TemplateHints,以及来自 H&O 的许多爱。
开发者
此模块由 H&O 团队开发。有关此模块的更多信息,请访问 H&O 网站:H&O Magento 2 高级模板提示模块