Location: PHPKode > projects > Blackwolf CMF > projectBlackWolf/lib/Template/TokenParser/Var.class.php
<?php
/* Please see the README and LICENSE files. */

/**
 * This class parses variable tokens
 */
class Template_TokenParser_Var implements Template_TokenParser {
    
    /**
     * @see Template_TokenParser
     */
    public function parse($type,$params, $vars = NULL, $model = NULL) {
        if(!is_null($vars) && array_key_exists(1,$type)){
            $array = $type[1];
            if(!is_array($array)){
                if(array_key_exists($type[1],$vars)){
                    return $vars[$type[1]];
                } else {
                    return "todo";
                }
                
            } else {
                print_r($type);
            } 
        }
        return false;
    }
}
?>
Return current item: Blackwolf CMF