Skip to content

Instantly share code, notes, and snippets.

@victorferraz
Created May 2, 2012 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorferraz/2572748 to your computer and use it in GitHub Desktop.
Save victorferraz/2572748 to your computer and use it in GitHub Desktop.
Sidebar Tutorial
<?php
/*
* @package Sidebar
* @version 1.0
* @author Victor Ferraz
* @copyright Copyright (c) 2011, Victor Ferraz
* @license http://www.gnu.org/licenses/gpl-3.0.txt
*/
class Sidebar
{
private $ultimas_noticias;
function __construct()
{
//Chamanda instäncia para a utilização do objeto do codeigniter
$CI = & get_instance();
$CI->load->model('noticias');
}
public function posts()
{
$this->ultimas_noticias = $CI->noticias_model->ultimos_posts();
return $this->ultimas_noticias;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment