0
您好,我尝试添加自己的自定义模板磁阻,但我无法做到这一点,我使用以下给出的步骤如下 首先我在应用程序/代码/本地创建一个自己的目录如何在magento中添加自己的自定义模板
- FirstNameSpace
- FirstWeb
-controllers
-IndexController.php
和IndexController.php作为
<?php
class FirstNameSpace_FirstWeb_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
$this->loadLayout();
}
public function testAction()
{
echo "test action";
}
}
代码和磁应用的/ etc /模块/ FirstNameSpace_FirstWeb.xml
代码作为
<?xml version="1.0"?>
<config>
<modules>
<FirstNameSpace_FirstWeb>
<active>true</active>
<codePool>local</codePool>
</FirstNameSpace_FirstWeb>
</modules>
</config>
而且在应用程序/设计/前端/预设/默认/布局/ firstweb.xml 这样的代码
<layout version="0.1.0">
<firstweb_index_index translate="label">
<label>Contact Us Form</label>
<reference name="content">
<block type="core/template" name="contactForm" template="firstweb/form.phtml"/>
</reference>
</firstweb_index_index>
</layout>
,并在像
模板/ firstweb/form.phtml嗨!你好吗 !这是第一个例子
像这样
<?xml version="1.0"?>
<config>
<modules>
<FirstNameSpace_FirstWeb>
<version>0.1.0</version> <!-- Version number of your module -->
</FirstNameSpace_FirstWeb>
</modules>
<frontend>
<routers>
<firstweb>
<use>standard</use>
<args>
<module>FirstNameSpace_FirstWeb</module>
<frontName>firstweb</frontName>
</args>
</firstweb>
</routers>
<!-- This node contains module layout configuration -->
<layout>
<updates>
<contact>
<file>firstweb.xml</file>
</contact>
</updates>
</layout>
</frontend>
</config>
Now if i hit the page :http://localhost/magento/index.php/firstweb/index
config.xml文件我没有得到任何回应
plz帮助我,让我能够在磁加载布局
它仍然无法正常工作。我正在尝试很多时间。你能否给我提供完整的例子 – kavita
来吧@kavita,“它仍然不工作”根本没有帮助。考虑聘请专业人员为你做这项工作。 – michi