[eluser]abbe01[/eluser]
Hi,
I am using text helper of CI. I have load the helper in my controllers.
But, once I use it for word wrap the row data form my database, it will come to this error message.
Quote:
Fatal error: Using $this when not in object context in C:\Inetpub\wwwroot\voxcms\system\helpers\text_helper.php on line 395
How to use the text_helper instead? I found that i m not able to use the text_helper while loading my db row data set.
below is my code, which I would like to word_wrap my $row->postcontent:
Code:
$post_count = $query->num_rows();
$i = 0;
if ($post_count > 0){
foreach($query->result() as $row){
$postcontent = $row->postcontent;
//extract($posts[$i]);
$postcontent = word_wrap($postcontent, 6);
echo "<tr>\n";
echo " <td><input type=\"checkbox\" name=\"tick$i\" value=\"$row->postid\" /></td>\n";
echo " <td>$row->posttitle</td>\n";
echo " <td>$postcontent</td>\n";
echo " <td> </td>\n";
echo " <td>$row->createdate</td>\n";
echo " <td>$row->createdby</td>\n";
echo " <td><a href=\"post.php?id=$row->postid\" id=\"imghref\"><img src=\"images/edit.gif\" title=\"edit\" /></a></td>";
echo "</tr>\n";
$i++;
}
Hope anyone can point it out, how I am going to implete this.
Thanks.