0

こんにちは皆さん私はウェブサイトにjoomla2.5を使用しています

バックエンドのデータベースに商品を挿入するコンポーネントを作成し、この商品をフロントエンドに表示したい

type = 1の製品を表示するために、このリンクがビューにあります。

 <div class="col2"><a href="<?php echo $this->baseurl ?>/index.php/hardware/integrados">Productos</a></div>

コンポーネントcontroller.phpのフロントエンドにこれがあります

class HardwareController extends JController
    function integrados(){
            $model = &$this->getModel(JRequest::getCmd('view'));
            $view  = &$this->getView(JRequest::getCmd('view'), 'html');
        $view->setModel($model, true);
        $view->hardwareIntegrado();
    }

私のモデルでは

class HardwareModelHardwares extends JModelList 
     function getIntegrados(){
         $db=& JFactory::getDBO();
         $query= "SELECT *
            FROM ".$db->nameQuote('#__hardware')."
            WHERE ".$db->nameQuote('tipo')."=".$db->quote("1").";";
         $db->setQuery( $query);
         $restaurantes=$db->loadObjectList();
         JRequest::setVar('hard', $restaurantes);
         return $restaurantes;
    }

そして私のview.html.phpで私はこれを持っています

public function hardwareIntegrado(){
    $this->assignRef('pagination', $this->get('pagination'));
    $this->assignRef('hardware', $this->get('integrados'));
    $this->assignRef('list', $this->get('list'));
    parent::display();
}

リンクをクリックすると、このエラーが発生します

500 - View not found [name, type, prefix]: hardware, html, hardwareView

何か案が!

4

2 に答える 2

1

ビュークラスをhardwareViewHardwareに変更する必要があります

于 2013-01-16T09:13:33.350 に答える
0

このエラーが発生しています-

500 - View not found [name, type, prefix]: hardware, html, hardwareView

ビューを探しているためです。hardwareリンクindex.php/hardware/integradosでは、あなたが渡しているようですview=hardware。どこでもhardwares、フォルダー名とクラスのように定義していますが、リンクまたはクラスとフォルダーを変更します。

これが役立つことを願っています。

于 2013-01-19T07:19:33.877 に答える