Joomla 2.5 在组件布局中加载自定义字段致命错误 [英] Joomla 2.5 Load custom field in components layout fatal error

查看:18
本文介绍了Joomla 2.5 在组件布局中加载自定义字段致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的后端组件默认视图 (default.php) 中加载自定义字段:

Im trying to load custom field in my backend component default view (default.php):

JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
$productType = JFormHelper::loadFieldType('ProductType',false);

$productTypeOptions = $productType->getOptions(); 

但我收到一个致命错误:

But I get a fatal error:

Fatal error: Call to a member function children() on a non-object in xxxlibrariesjoomlaformfieldslist.php on line 89

当我将此自定义字段加载到表单中时,一切正常.

When I load this custom field into the form, everything works perfectly.

有什么想法吗?

推荐答案

确保您添加的字段路径正确

Make sure you are adding the correct path to the fields

这篇关于Joomla 2.5 在组件布局中加载自定义字段致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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