вот мой код:
function news()
{
$limit = $this->attribute('limit', 5);
$category = $this->attribute('category');
$order_by = $this->attribute('order-by', 'created_on');
//deprecated
$order_dir = $this->attribute('order-dir', $this->attribute('order', 'ASC'));
if ($category)
{
$this->db->where('c.' . (is_numeric($category) ? 'id' : 'slug'), $category);
}
$posts = $this->db
->select('blog.*')
->select('c.title as category_title, c.slug as category_slug')
->select('p.display_name as author_name')
->where('status', 'live')
->where('created_on <=', now())
->join('blog_categories c', 'blog.category_id = c.id', 'left')
->join('profiles p', 'blog.author_id = p.user_id')
->order_by('blog.' . $order_by, $order_dir)
->limit($limit)
->get('blog')
->result();
$post_urls[] = array();
foreach ($posts as $post) {
$post->url = site_url('blog/'.date('Y', $post->created_on).'/'.date('m', $post->created_on).'/'.$post->slug);
$post_urls[] = $post->url;
}
print_r($post_urls);
return $post_urls;
}
принтит всё правильно,несколько значений,а вот return ничего не возвращает(