0

我的组件中的 Joomla 布局有问题..文件/类名称约定一定有问题..我试图在 Joomla 开发者论坛上提问,但没有人回答..所以我收到这个错误.. 500 - 查看未找到 [name, type, prefix]: PostToBank,,postToBankView 该视图位于 views/postTobank/view.php 中,名称为 postToBankViewPostToBank 在我的 controllers/controller.php 文件中,我有一个名为 PaymentController 的类,其中包含这部分代码。

$view = $this->getView('PostToBank','','postToBankView');
        $this->getModel("Payment")->savePaymentData($data);
        foreach ($data as $key => $value) {
            $view->assignRef($key, $value);
        }
        $view->setLayout('postTobank');
        $view->display();    

我的 view.php 文件看起来像这样

class postToBankViewPostToBank extends JView{
function display($tpl=null){


    //display set template

    parent::display($tpl);
}

附加
图像上是我的组件的完整文件夹结构。请问这有什么问题吗?谢谢

我的组件的文件夹结构

4

1 回答 1

0

Joomla 使用命名约定,而您没有遵循它们。请参阅http://docs.joomla.org/File_Structure_and_Naming_Conventions

此外,您的意见应该是view.html.php然后您不需要调用setView. 仅供参考:这是错误的来源。请参阅:http ://docs.joomla.org/API16:JController/getView ,即使它是 1.6 文档,它在 1.5 中也是一样的

查看本教程并采用常规约定:http ://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1

于 2011-05-16T04:53:52.180 回答