/** {@inheritdoc} */ public function index($data) { if (Util::arrayHasData($data)) { // does the request end with .json $jsonRequest; try { $this->removeFileExtensionFromURLData($data, '.json'); $jsonRequest = true; } catch (UnexpectedValueException $e) { $jsonRequest = false; } // if this is a json request if ($jsonRequest) { try { $this->_processJsonRequest($data); return; } catch (RuntimeException $e) { throw new PageNotFoundException(); } } else { } throw new PageNotFoundException(); } $this->_indexPage(); }
/** {@inheritdoc} */ public function index($data) { if (Util::arrayHasData($data)) { throw new PageNotFoundException(); } $this->_indexPage(); }
public function contact($data) { if (Util::arrayHasData($data)) { throw new PageNotFoundException(); } $data = array(); $meta = array('title' => 'Contact Us - Grand Training'); $this->_renderPage('about/contact.php', $data, $meta); }
/** {@inheritdoc} */ public function index($data) { if (Util::arrayHasData($data)) { $r_data = array_slice($data, 1); switch ($data[0]) { default: throw new PageNotFoundException(); break; case 'test.html': $this->_test_dot_html($r_data); break; } return; } $this->_indexPage(); }
/** * echo out json of the course dates availiable * A courseid can be specified in $_GET to refine the selection * @param array $data Any additional path data passed in the url * @throws PageNotFoundException if $data contains any data */ private function _dates_dot_json($data) { if (Util::arrayHasData($data)) { throw new PageNotFoundException(); } $model = new Model(); $courseid = isset($_GET['course']) ? $_GET['course'] : 0; header('Content-type: application/json'); echo json_encode($model->getCourseDates($courseid)); }