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"
        ;
    }
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"
        ;
    }
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" ; }
Get a php template file path based on the given parameters.
@param string $name Name of element.
@param string $type Main type of template.
@param string $subtype Subtype of template.
@param string $dir Relative dir to templates path where template resides.
@param string $overrides_prefix In case $dir is shared with other template types.
@param string $namespace Namespace of the $name element.
@return string
Get a php template file path based on the given parameters .