HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers59/ferrumbv.nl/wwwroot/app/controllers/c_machines.class.php
<?php
/**
 * c_machines.class.php
 * Created by Komma Mediadesign.
 * Author: mike
 * Date: 11/02/14
 */


class Machines extends Controller
{
    public function __construct()
    {
        parent::__construct();
    }

    /*
     * Index of the home page
     */
    public function index()
    {
        // Title
        $this->View->setData('page_title', 'Machines | ' . SITE_NAME );

        $this->setPageElements();

        // Load template view
        $this->View->render('v_template');
    }

    public function machinesDetail()
    {
        // Title
        $Parser = new XML_Parser('machines');
        $current = $Parser->getCurrent();

        $this->View->setData('page_title', $current['title'] . ' | Machines | ' . SITE_NAME );

        $this->setPageElements();

        // Load template view
        $this->View->render('v_template');
    }

    private function setPageElements()
    {
        // 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);
        }
    }

    public function machine_list()
    {
        $this->View->setData('page_title', 'Machinelijst | Machines | ' . SITE_NAME );

        // What object does the view need, with what params
        $objects = array('breadcrumb'=>'current',
            'submenu'=>'all',
            'gallery'=>'current');

        // 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_machine_list');
    }
}