[eluser]neverstop[/eluser]
Hi and tanks for the answer. Yes you are right in using $CI =& get_instance(); but still not working. I changed my code to a simple one, take a look:
Code:
<?php
class Main extends Controller
{
function __construct()
{
parent::Controller();
}
function index()
{
$this->load->library("Artigos");
$val["title"] = "Altus :: Evoluçao em Automaçao";
$this->Artigos->showArticles();
$this->load->view("mainview", $val);
}
}
?>
and
Code:
<?php
if (!defined("BASEPATH"))
exit('No direct script access allowed');
class Artigos
{
function showArticles()
{
/*
$CI =& get_instance();
$query = $CI->db->query("SELECT * FROM artigos");
$articles = "";
foreach ($query->result() as $row)
{
$articles .= "<p><b>";
$articles .= $row->date . " · ";
$articles .= "<a href=\"#\">" . $row->name . "</a></b><br>";
$content_complete = $row->content;
$content_edited = html_entity_decode(substr($content_complete, 0, 120));
$last_position = strrpos($content_edited, " ");
$articles .= substr($content_edited, 0, $last_position) . " ...</p>";
}
return($articles . $this->paginationArticles());
*/
}
}
?>
As you can see i commented the code of my function. And now whats the problem? Lol seems to be very simple but i can't get the solution to my problem =/. The same erros still ocurring.