Source of file ListingPageController.php
Size: 1,031 Bytes - Last Modified: 2021-12-23T10:32:47+00:00
/var/www/docs.ssmods.com/process/src/src/ListingPageController.php
12345678910111213141516171819202122232425262728293031323334 | <?php namespace Symbiote\ListingPage; use PageController; use SilverStripe\Control\HTTPRequest; class ListingPageController extends PageController { private static $url_handlers = array( '$Action' => 'index' ); public function index(HTTPRequest $request) { // This is required so the listing page doesn't eat AJAX requests against the page controller. $action = $request->latestParam('Action'); if ($action && $this->hasMethod($action) && in_array($action, $this->config()->allowed_actions)) { return $this->$action(); } if ($this->data()->ContentType || $this->data()->CustomContentType) { // k, not doing it in the theme... $contentType = $this->data()->ContentType ? $this->data()->ContentType : $this->data()->CustomContentType; $this->response->addHeader('Content-type', $contentType); return $this->data()->Content(); } return array(); } } |