2011-08-25 94 views
0

我正在編寫自定義聯繫我們page.When我訪問URL http://localhost/dev/contactus/index/我越來越404 Not Found error.Here是我的config.xml(app/code/local/dZ/ContactUs/etc /)文件自定義擴展名不工作在Magento

<?xml version="1.0"?> 
<config> 
    <modules> 
     <dZ_ContactUs> 
      <version>1.0.0</version> 
     </dZ_ContactUs> 
    </modules> 

    <frontend> 
     <routers> 
      <JustSomeFreeRouterNameHereNo1> 
       <use>standard</use> 
       <args> 
        <module>dZ_ContactUs</module> 
        <frontName>contactus</frontName> 
       </args> 
      </JustSomeFreeRouterNameHereNo1> 
     </routers> 
    </frontend> 
</config> 

IndexController.php(應用程序/代碼/本地/ DZ /聯繫我們/控制器)

<?php 
class dZ_ContactUs_IndexController extends Mage_Core_Controller_Front_Action 
{ 
    public function indexAction() 
    { 
     var_dump(__METHOD__); 
    } 
} 
?> 

和dZ_ContactUs.xml(表觀的/ etc /模塊/)

<?xml version="1.0"?> 
<config> 
    <modules> 
     <dZ_ContactUs> 
      <active>true</active> 
      <codePool>local</codePool> 
     </dZ_ContactUs> 
    </modules> 
</config> 

日誌不顯示任何內容。出了什麼問題?

回答

1

你不應該調用你的命名空間「dZ」。它應該始終以大寫字母開頭。在你的config.xml中,在模塊標籤中,你寫了「dZ_ContactUs」。 Magento會將其翻譯爲app/code/local/DZ/ContactUs(請注意「DZ」中的大寫字母!)。因此,如果您將命名空間重命名爲「Dz」或「DZ」,則一切都應該正常工作。

希望這可以解決您的問題。

+0

是的。謝謝你的幫助! – blakcaps