Current File : /home/users/barii/public_html/finansenl.com.pl/wodki/modules/news/classes/News/Core.php |
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Message is a class that lets you easily send messages
* in your application (aka Flash Messages)
*
* @package Message
* @author Dave Widmer
* @see http://github.com/daveWid/message
* @see http://www.davewidmer.net
* @copyright 2010 © Dave Widmer
*/
class News_Core
{
public function __construct()
{
}
/**
* Displays the message
*
* @return string Message to string
*/
public static function display()
{
$news = self::get();
if( $news ){
return View::factory('news/basic')->set('news', $news)->render();
} else {
return '';
}
}
/**
* The same as display - used to mold to Kohana standards
*
* @return string HTML for message
*/
public static function render()
{
return self::display();
}
public static function get()
{
return ORM::Factory('News')->order_by('id','desc')->limit(2)->find_all();
}
}