$propertyList[]= ($database->loadObjectList() );
AS数据库var是,$database =& JFactory::getDBO();
结果 - >
Array
(
[0] => Array
(
[0] => stdClass Object
(
[value] => 1
[text] => Apartment
)
[1] => stdClass Object
(
[value] => 2
[text] => Duplex
)
[2] => stdClass Object
(
[value] => 3
[text] => Villa
)
[3] => stdClass Object
(
[value] => 4
[text] => Paint house
)
[4] => stdClass Object
(
[value] => 5
[text] => Chalet
)
}}
我怎么能在没有( [0] => Array )
的情况下传输所有数据,因为我想将组件读入下拉列表?
答案 0 :(得分:1)
为什么要将它加载到$ propertyList []中?使用“[]”将它添加到数组中。如果你要删除这两个括号,你就不应该得到一个带数组的数组。
$propertyList = $database->loadObjectList();