@happy gupta : You are not using the elgg way fo coding. do it like
$options_values = array();
$groups = elgg_get_entities(array(
'type' => 'group',
'limit' => 0,
'joins' => array("JOIN {$db_prefix}groups_entity g on e.guid = g.guid"),
'order_by' => "g.name ASC",
));
foreach($groups as $group){
$options_values[$group->guid] = $group->name;
}
echo elgg_view('input/dropdown', array('name' => 'group_list', 'options_values' => $options_values, 'value' => $value));
Edit : @Rvr : You were more fast :)
@RvR.. Your code doesn't return anything... its blank..!!!
i used it like this...
$dbprefix = elgg_get_config("dbprefix");
$group_options["joins"] = array("JOIN " . $dbprefix . "groups_entity ge ON e.guid = ge.guid");
$group_options["order_by"] = "ge.name ASC";
$content = elgg_list_entities_from_metadata($group_options);
foreach ($content as $group){
echo '<option value="'.$group->guid.'">'.$group->name.'</option>';
}
@Team Webgalli.. Your code is giving a Fatal Error.
An unrecoverable error has occurred and has been logged. Contact the site administrator with the following information:
Exception #1366547285.
Look into error logs and debug it, put some efforts from your side also.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.