Magento Grid Container Block 未加载网格 [英] Magento Grid Container Block not loading grid

查看:22
本文介绍了Magento Grid Container Block 未加载网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用模块创建器设置了一个带有网格视图的管理模块,效果很好,但现在我需要在同一个模块中添加另一个网格视图.

I just set up an admin module with a grid view using the module creator, and it works great, but now I need to add another grid view within the same module.

我复制并重命名了所有与网格视图相关的文件(控制器和块文件,但不是模型,因为我正在做的事情不需要它们),并将新创建的块添加到布局 xml 下处理它的新控制器.

I copied and renamed all the files relevant to the grid view(controllers and block files, but not models, as they are not needed for what I'm doing) , and added the newly created block to the layout xml under the handle for it's new controller.

使用 Firephp,我发现对于我的新视图,一切都可以正常加载,直到 Grid.php 没有加载,最终输出只是一个空白页面.

Using Firephp, I've worked out that everything loads fine for my new view up until the Grid.php which doesn't load, and the end output is just a blank page.

据我所知,这个新视图在所有方面都与模块生成的原始工作网格视图相同,但名称除外,那么是什么导致它无法识别或加载 Grid.php?

As far as I'm aware, this new view is identical to the original working grid view generated by the module in all aspects except name, so what could be causing it to not recognize or load the Grid.php?

推荐答案

在网格容器块中查看 $_blockGroup$_controller 的值.容器使用它们来查找和加载网格块.如果您真的想知道发生了什么,请查看 parent::_prepareLayout() 方法.

In the grid container block look at the values for $_blockGroup and $_controller. These are used by the container to find and load the grid block. If you really want to see what is going on look at the parent::_prepareLayout() method.

附注:
$_blockGroup 是您的模块名称.
$_controller 是你的网格块的路径.

PS:
$_blockGroup is your module's name.
$_controller is the path to your grid block.

PPS:
如果这还不够,把它放在你的 .htaccess 中:

php_flag display_errors on
SetEnv MAGE_IS_DEVELOPER_MODE true

如果网格在集合的 SQL 或其他方面有问题,您应该获得更多信息.

You should get a lot more information if the grid is having problems with it's collection's SQL or something.

这篇关于Magento Grid Container Block 未加载网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆