Skip to content

Instantly share code, notes, and snippets.

@sasajib
Created May 18, 2014 19:22
Show Gist options
  • Save sasajib/9910ef4ff0f94e631f8a to your computer and use it in GitHub Desktop.
Save sasajib/9910ef4ff0f94e631f8a to your computer and use it in GitHub Desktop.
<?php namespace Sasajib\Pavilion\Api\NewsHeap;
use BaseController;
class Controller extends BaseController
{
public function getNewsCollection($newsType, $limit = 6)
{
$newsHeap = $this->getNewsHeapClass();
return $newsHeap->getNewsCollection($newsType, $limit);
}
public function getNews($slug)
{
$newsHeap = $this->getNewsHeapClass();
return $newsHeap->getNews($slug);
}
protected function getNewsHeapClass()
{
return new NewsHeap((new Response));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment