Greetings all,
I have been having problems with displaying metadata of an entity. I
am trying to modify the my_forms.php under the form plugin to display
some information to the user. My code segment is as following:
(pre-existing objects: $entity)
$entity_guid = $entity->getGUID();
$name = 'your_weight';
$id = get_metastring_id($name);
echo elgg_echo($id); //statement 1
$weight = get_metadata_byname($entity_
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.
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- purgatory@nanli0416
purgatory - 0 likes
- Ankit@ankitbarot
Ankit - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
You must log in to post replies.$weight = get_metadata_byname($entity_ guid, $name);
$weightVal = $weight->value;
echo elgg_echo($weightVal);
Thank you so much! Your solution worked!:) I also tried another way, which worked too:
$weight = $entity->$name;
echo elgg_echo($weight);
Thank you again!
Hey guys,
I am facing the problems with fetching data posted by forms from admin. I dont know exactly how to fetch the records from database.Please help me.
Thanks.
@P
Code I posted is "standard" method for manipulating metadata.
Code you posted is "implicit" style for handling entities' metadata.
Both work ok..