[eluser]tarciozemel[/eluser]
That's isn't the way to use DataMapper... Do you read the manual?
[quote author="wisepotato" date="1338724127"]is it possible to insert custom variables into your models ? (that's what I use models for) For example I have a photo model, and I want to access $photo->link to insert a link into the template.
How should I go about doing this? I have done this:
public function get($limit = NULL, $offset = NULL)
{
// call the original method
parent::get($limit, $offset);
//we need to loop over every object
$this->img_src = 'images/' . $that->image;
$this->href = site_url('media/fotos/' . $that->id . '/');
// for method chaining
return $this;
}[/quote]