我正在尝试覆盖模块中的register.phtml,但似乎存在一些配置问题,这些问题使Magento无法使用我的自定义模板覆盖核心模块中的模板。我检查了代码,但找不到问题。有人可以帮忙吗?提前致谢。module.xml:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Namespace_ModuleName" setup_version="0.0.2">
<sequence>
<module name="Magento_Customer"/>
</sequence>
</module>
</config>
命名空间\模块名称\视图\前端\布局下的customer_account_create.xml:
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<referenceBlock name="customer_form_register">
<arguments>
<argument name="template" xsi:type="string">Namespace_ModuleName::form/register.phtml</argument>
</arguments>
</referenceBlock>
</layout>
composer.json:
{
"name": "namespace/module-modulename",
"description": "modulename",
"type": "magento2-module",
"version": "0.0.2",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"php": "~5.5.0|~5.6.0",
"magento/framework": "~0.42",
"magento/magento-composer-installer": "*",
"magento/module-customer": "*"
},
"extra": {
"map": [
[
"*",
"Namespace/ModuleName"
]
]
}
}