Php 应用/设计和应用/代码使用的正确方式Magento 2 Adminhtml
我想了解两件事:Php 应用/设计和应用/代码使用的正确方式Magento 2 Adminhtml,php,module,magento2,Php,Module,Magento2,我想了解两件事: 扩展Magento 2 Admin CSS(或执行更少操作的正确方法?)以从原始后端复制CSS/less 在后端重写,例如:销售>订单>被调用的文件vendor/magento/module backend/view/adminhtml/templates/pageactions.phtml 我跟着 & 检查不同的stackoverflow柱,如 但我现在无法正确理解这一点 例如,我希望覆盖magento登录的CSS。我何时使用应用程序/代码,何时使用应用程序/设计,原因是
app/code/Vendor
└── ExampleAdminNewPage
├── composer.json
├── Controller
│ └── Adminhtml
│ └── HelloWorld
│ └── Index.php
├── etc
│ ├── adminhtml
│ │ ├── menu.xml
│ │ └── routes.xml
│ ├── di.xml
│ └── module.xml
├── registration.php
└── view
└── adminhtml
├── layout
│ └── exampleadminnewpage_helloworld_index.xml
└── templates
├── helloworld.phtml
├── intro.css
└── js.phtml
app/code/Vendor/ExampleAdminNewPage/etc/di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Theme\Model\View\Design">
<arguments>
<argument name="themes" xsi:type="array">
<item name="adminhtml" xsi:type="string">Vendor/Test_Admin</item>
</argument>
</arguments>
</type>
</config>
下面的回音不起作用,我原以为如果我去销售>订单,我会看到这个回音?app/design/adminhtml/Vendor/Test\u Admin/Magento\u sales/templates/items/column/name.phtml
<?php echo 'test'; ?>
我也不知道如何让JS工作,目前我有。
app/design/adminhtml/Vendor/Test_Admin/web/js/requirejs-config.js
var config = {
map: {
'*': {
customAdmin: 'Vendor_Test_Admin/js/customAdmin'
}
},
deps: ["jquery"]
};
app/design/adminhtml/Vendor/Test\u Admin/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Vendor_ExampleAdminNewPage',
__DIR__
);
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'adminhtml/Vendor/Test_admin', // Example: 'adminhtml/Magento/backend'
__DIR__
);
<?php echo 'testpageaction'; ?>
span {
background-color: red !important;
}
var config = {
map: {
'*': {
customAdmin: 'Vendor_Test_Admin/js/customAdmin'
}
},
deps: ["jquery"]
};
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'adminhtml/Vendor/Test_admin', // Example: 'adminhtml/Magento/backend'
__DIR__
);
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Test_Admin Theme</title> <!-- your theme's name -->
<parent>Magento/backend</parent> <!-- the parent theme. Example: Magento/backend -->
</theme>