Opened 2 years ago
Closed 2 years ago
#3346 closed Feature Request (wontfix)
Implementation of magic method __toString
| Reported by: | Germanaz0 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Needs Review |
| Component: | Core | Version: | 1.7 |
| Severity: | minor | Keywords: | |
| Cc: | brett@… | Difficulty: |
Description
To simplify the way to view entities should be a better feature, to have in ElggEntity a magic method toString, so in this way we could have something like this.
class ElggEntity ... {
public function toString() {
return elgg_view_entity($this, TRUE);
}
...
}
So if we have fore example a profile of something in the controller we could make something like that.
$ob = new ElggUser($userGUID);
echo $ob;
Change History (2)
comment:1 Changed 2 years ago by cash
comment:2 Changed 2 years ago by cash
- Resolution set to wontfix
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.

Not a fan of this. Prefer Evan's suggestion of generalizing elgg_view so that you can do this elgg_view($entity). The reason being is that you frequently want to pass a parameter to the view so why have two different methods based on how many parameters I want to pass.