Skip to content
This repository
branch: master
Ifeoluwa Walter June 18, 2013
executable file 51 lines (30 sloc) 0.794 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
<?php
class Helper {

protected $variables = array();
protected $_action;

/** Set Variables **/



function set($name,$value) {
$this->variables[$name] = $value;
}

/** Display Template **/

    function render() {

$backtrace = debug_backtrace();
$function = strtolower($backtrace[1]['function']);

extract($this->variables);

$contents = '';

if (file_exists(ROOT . DS . 'views' . DS . 'helpers' . DS . $function . '.php')) {
$filename = (ROOT . DS . 'views' . DS . 'helpers' . DS . $function . '.php');

if (is_file($filename)) {
ob_start();
include $filename;
$contents = ob_get_contents();
ob_end_clean();
}
}

$this->variables = array();

return $contents;

    }



}

function getContent($filename) {

    return false;
}
Something went wrong with that request. Please try again.