Joomla 2.5在组件布局中加载自定义字段致命错误 [英] Joomla 2.5 Load custom field in components layout fatal error
本文介绍了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 xxx\libraries\joomla\form\fields\list.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屋!
查看全文