这个Magento代码有什么问题? - 简单的例子

这个Magento代码有什么问题? - 简单的例子

问题描述:

我想按照这个非常受欢迎的教程在这个网址:http://alanstorm.com/magento_admin_controllers这个Magento代码有什么问题? - 简单的例子

我尝试了第一个测试 - “测试它”下,我没有得到重定向到我的登录屏幕,然后到带空白页面的控制面板。相反,我得到了...

对url的响应http://mymagentotest.com/index.php/adminhelloworld/产生下面的消息。我一遍又一遍地尝试,每次都得到完全相同的结果 - 这告诉我,我正在学习如何做到这一点错误,我一遍又一遍地犯同样的错误。我需要帮助,或者我们需要帮助,因为我确信我不是唯一的帮助。

哎呦,我们的坏...你 请求的页面不存在,我们有一个 罚款猜测原因。如果您直接输入网址 ,请确保 拼写正确。如果您点击 的链接来到这里,链接是 过期。

我看不出什么是错的,一切看起来都很好,但我不得不猜测配置文件的结构。我认为这是问题所在。这里是我的代码....

app/code/local/Alanstormdotcom/Adminhelloworld/etc的配置文件...

<config> 
<!-- ... --> 
<admin> 
    <routers> 
     <the_name_of_this_element_is_not_important_it_should_be_unique> 
      <use>admin</use> 
      <args> 
       <module>Alanstormdotcom_Adminhelloworld</module> 
       <frontName>adminhelloworld</frontName> 
      </args> 
     </the_name_of_this_element_is_not_important_it_should_be_unique> 
    </routers> 
</admin> 
<!-- ... -->   
</config> 

指数控制器app/code/local/Alanstormdotcom/Adminhelloworld/controllers

<?php class Alanstormdotcom_Adminhelloworld_IndexController extends Mage_Adminhtml_Controller_Action 
{ 
    public function indexAction() 
    { 
     $this->loadLayout(); 
     $this->renderLayout(); 
    } 
} 

app/etc/modulesAlanstormdotcom_adminHelloworld.xml ..

<config> 
    <modules> 
     <Alanstormdotcom_Adminhelloworld> 
      <version>0.1.0</version> 
     </Alanstormdotcom_Adminhelloworld> 
    </modules> 
</config> 

签名:倒塌,感觉注定失败。我必须努力学习这些东西,对于我的工作,如果我失败了,我最终会住在巷子里的一个漂亮的盒子里。

通常你有XML的两位应该合并到app/code/local/Alanstormdotcom/Adminhelloworld/etc/config.xml第二个文件,app/etc/modules/Alanstormdotcom_adminHelloworld.xml,反而会是这样的:

<config> 
    <modules> 
     <Alanstormdotcom_Adminhelloworld> 
      <active>true</active> 
      <codePool>local</codePool> 
     </Alanstormdotcom_Adminhelloworld> 
    </modules> 
</config> 

虽然它看起来像一个巨大的艰苦的斗争,以新人你他们要么掌握它,要么变得更有能力或学习使用像ModuleCreator这样的自动化工具。无论发生哪种情况,你都会回过头来想知道你是如何挣扎的。