public function index(SS_HTTPRequest $request) { $screenshots = ModuleScreenshot::get()->limit(20); if ($search = $request->getVar('Title')) { $screenshots = $screenshots->filter(array('Title:PartialMatch' => $search)); } return array('Results' => $screenshots); }
public function show(SS_HTTPRequest $request) { $shot = ModuleScreenshot::get()->byID($request->param('ID')); if (!$shot) { return $this->httpError(404, 'That Screen shot could not be found'); } return array('ModuleScreenshot' => $shot); }