File: D:/HostingSpaces/SBogers59/ferrumbv.nl/wwwroot/app/controllers/c_products.class.php
<?php
/**
* c_products.class.php
* Created by Komma Mediadesign.
* Author: mike
* Date: 11/02/14
*/
class Products extends Controller
{
public function __construct()
{
parent::__construct();
}
/*
* Index of the home page
*/
public function index()
{
// Title
$this->View->setData('page_title', 'Producten | ' . SITE_NAME );
// What object does the view need, with what params
$objects = array('breadcrumb'=>'current',
'submenu'=>'all',
'product_thumb'=>'all',
);
// Factory
$Factory = new Template_Factory(strtolower(get_class($this)));
$data = $Factory->create($objects);
// Set data for the view
foreach($data as $name => $value)
{
$this->View->setData($name,$value);
}
// Load template view
$this->View->render('v_product_overview');
}
/*
* Index of the home page
*/
public function product_detail()
{
// Title
// What object does the view need, with what params
$objects = array('breadcrumb'=>'current',
'submenu'=>'all',
'gallery'=>'current',
'h1'=>'current',
'description'=>'current',
'read_more'=>'both');
// Factory
$Factory = new Template_Factory(strtolower(get_class($this)));
$data = $Factory->create($objects);
// Set data for the view
foreach($data as $name => $value)
{
$this->View->setData($name,$value);
}
$Parser = new XML_Parser('products');
$current = $Parser->getCurrent();
$this->View->setData('page_title', $current['title'] . ' | Producten | ' . SITE_NAME );
// Load template view
$this->View->render('v_product_detail');
}
}