Hi,
I'm new to FuelPHP, and my PHP is rusty - I apologise if this is massively obvious!
I have a fixture model (generated with OIL), which represents a rugby match. The model has a 'home_team' property, which is a key to the teams table.
When displaying fixtures in the admin panel (or anywhere really) I'd obviously like to display the team names rather than their IDs.
So, I added the following function to my fixture model:
public static function getHomeTeamName() {
return Model_Team::find($this->home_team)->name;
}
Then in my view, I simply want to echo $fixture->getHomeTeamName();
However, I get an error (using $this in a non-object context).
Am I on the right lines? Or would I be better doing this with a DB join in the first instance?