File: D:/HostingSpaces/SBogers68/resortouddorpduin.nl/wwwroot/app/controllers/c_nieuws.class.php
<?php
/**
* c_home.class.php
* Created by Komma Mediadesign.
* Author: mike
* Date: 11/02/14
*/
class Nieuws extends Controller
{
public function __construct()
{
parent::__construct();
}
/*
* Index of the home page
*/
public function index()
{
// Title
$this->View->setData('page_title', SITE_NAME);
// Load template view
$this->View->render('v_nieuws');
}
public function newsItem()
{
// url..
if ( ! defined('URL_SUB') || ! defined('URL_SUB2') || ! defined('URL_SUB3'))
{
Fn::notFound();
}
if (LANG_ROOT == '/de/'){
$nieuws = 'nachrichten/';
}else{
$nieuws = 'nieuws/';
}
$newsUrl = URL_SUB . '/' . URL_SUB2 . '/' . URL_SUB3;
if (URL_SUB3 != 'inloopmiddagen'){
$page = str_replace('-', '_', URL_SUB3);
$this->View->render($nieuws. '/v_' . $page);
}else{
switch($newsUrl)
{
case '2015/01/inloopmiddagen':
// Load template view
$this->View->render($nieuws. '/v_inloopmiddag_2015');
break;
case '2014/11/inloopmiddagen':
// Load template view
$this->View->render($nieuws. '/v_inloopmiddag_2014');
break;
default:
// Fn::notFound();
}
}
}
}