public function GetTemplatePath(
        $name, $type, $subtype, $dir, $overrides_prefix="", $namespace=""
    )
    {   
        if($namespace)
        {
            $namespace = strtolower(
                str_replace(
                    array("\\", "::"),
                    "_",
                    $namespace
                )
            ) . "_";
        }
        
        if($overrides_prefix)
        {
            $overrides_prefix = rtrim($overrides_prefix, "_") . "_";
        }

        $override = $this->templates_path
            . "{$dir}/{$overrides_prefix}overrides/"
            . "{$subtype}_" . $namespace . strtolower(
                str_replace(
                    array("/", "-", "."),
                    "_",
                    $name
                )
            )
            . ".php"
        ;

        if(file_exists($override))
        {
            return $override;
        }
        
        if($type)
            $type .= "_";

        return $this->templates_path
            . "{$dir}/"
            . "{$type}{$subtype}.php"
        ;
    }