ZapMachine/lib/ZAPController.class.php

41 lines
597 B
PHP
Raw Normal View History

<?php
/**
* Frontend handler
*/
class ZAPController {
/**
* String mode
*/
private $mode;
/**
* Parsable content object
*/
private $action;
/**
* Class prefix
*/
private $prefix = 'ZAP';
/**
* Constructor
*/
public function __construct($mode = 'home') {
$mode = trim(strip_tags($mode));
$this->mode = ucfirst($mode);
$clazz = $this->prefix . $this->mode;
if (!class_exists($clazz)) {
die('Wrong parameter');
}
$this->action = new $clazz();
}
/**
* @return string content
*/
public function fetch() {
return $this->action->getContent();
}
}
?>