Reputation: 173
I Wa't to display only Owner Name..in My Widget.. but i don't know how to do that.
Upvotes: 0
Views: 65
Reputation: 432
Elgg framework has a MVC architecture where View knows Model/entities.
To solve this, View needs to get the owner entity which has to display in your widget, so: in elgg/mod/(your widget folder)/views/default/widgets/(your name widget)/content.php, you should write the code of below:
<?php
$widget = elgg_extract('entity', $vars);
echo $widget->getOwnerEntity()->username;
Hope it helps!
Upvotes: 1