I'm using Codeigniter, and this is my issue:
I display some information about a product and this includes the name, date and description of it. In the description I use a "..See More" when it's longer than 100 characters.
The thing is that in my code when users click on "See More" in order to see complete product description, I'm facing the problem that I don't know how to send whole product object from one function to another. See the snippet:
foreach ($this->data['smallprizes'] as $key => $value) {
if(strlen($value->description)>100){
$stringCut = substr($value->description, 0, 100);
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).'...';
}else{
$string = $value->description;
}
$string = $string .'<a href= benefitSummary/'.$value->id.'>Leer Más</a>';
$sp[$value->id]['id'] = $value->id;
$sp[$value->id]['title'] = $value->title;
$sp[$value->id]['descrip'] = $string;
$sp[$value->id]['creation_date'] = $value->creation_date;
$sp[$value->id]['start_date'] = $value->start_date;
$sp[$value->id]['end_date'] = $value->end_date;
$sp[$value->id]['stock'] = $value->stock;
if ($value->status == 1) {
$status = 1;
}else{
$status = 0;
}
$sp[$value->id]['status'] = $status;
$this->data['sp'] = $sp;
}
the function that I want to send whole object is benefitSummary. I'm sending product ID in the href.
How do I do to get whole product object inside benefitSummary function?
Thanks in advance.
J.