0

我有这个我无法解决的问题。部分原因是我无法用正确的术语来解释它。我是新手,很抱歉这个笨拙的问题。

您可以在下面看到我的目标的概述。

我有一个名为Mall/Brand的扩展名

我想在自定义页面上添加我这样写的那个模块

品牌.xml

<brand_manufacturer_selectbrand>
      <reference name="content">
           <block type="brand/manufacturer" name="manufacturer_selectbrand" template="mall/brand/manufacturer/selectbrand.phtml"/>
      </reference>
</brand_manufacturer_selectbrand>

制造商控制器.php

public function selectbrandAction() {
    $this->loadLayout( array('default','brand_manufacturer_selectbrand'));
    $this->getLayout()->getBlock('head')->setTitle( Mage::helper('manufacturer')->__('Selected Brands'));
    $this->renderLayout();
}

在侧块文件夹Manufacturer.php

<?php
   class Mall_Brand_Block_Manufacturer extends Mage_Core_Block_Template {
       public function getManufacturer() { 
         $manufacturer = Mage::registry('current_manufacturer');
        if($manufacturer == null) {
            $id = Mage::app()->getRequest()->getParam('id');
            $manufacturer = Mage::getModel('brand/manufacturer')->load($id);
        }
        return $manufacturer;
    }
}
?>

对于前端selectbrand.phtml

<?php echo "hello"; ?>

仅用于检查

我在地址栏中尝试过这样

http://localhost/mage12/index.php/selectbrand

它的显示哇哦......我们的坏

我在这里做错了什么?

有任何想法吗 ?

4

1 回答 1

0

检查您在 etc/config.xml 中的前端名称

然后试试下面的网址

http://localhost/mage12/index.php/**frontend_name_in_config**/manufacturer/selectbrand

我认为您的前端名称是品牌,因此下面的网址可以使用

http://localhost/mage12/index.php/brand/manufacturer/selectbrand

希望对你有帮助

于 2013-10-10T18:32:46.520 回答