src/Resource.php
public static function getTplFileWithPath($templateFile, $packageName)
    {
        //for not changing a lot things, the best injection point is added theme support here.
        $theme = Resource::getCurrentTheme();
        $themePath = $theme;    // Openbizx::$app->getConfiguration()->GetThemePath($theme);
        if ($themePath) {
            $templateRoot = OPENBIZ_THEME_PATH . "/" . $themePath . "/template";
        } else {
            $templateRoot = SMARTY_TPL_PATH;
        }

        $names = explode(".", $packageName);
        if (count($names) > 0) {
            $moduleName = $names[0];
        }
        $packagePath = str_replace('.', '/', $packageName);
        // check the leading char '@'
        $checkExtModule = true;
        if (strpos($packagePath, '@') === 0) {
            $packagePath = substr($packagePath, 1);
            $checkExtModule = false;
        }

        $searchTpls = array(
            OPENBIZ_APP_MODULE_PATH . "/$packagePath/template/$templateFile",
            dirname(OPENBIZ_APP_MODULE_PATH . "/$packagePath") . "/template/$templateFile",
            OPENBIZ_APP_MODULE_PATH . "/$moduleName/template/$templateFile",
            //OPENBIZ_APP_MODULE_PATH."/common/template/$templateFile",
            $templateRoot . "/$templateFile"
        );
        if ($checkExtModule && defined('MODULE_EX_PATH')) {
            array_unshift($searchTpls, MODULE_EX_PATH . "/$packagePath/template/$templateFile");
        }

        // device
        if (defined('OPENBIZ_CLIENT_DEVICE')) {
            array_unshift($searchTpls, OPENBIZ_APP_MODULE_PATH . "/$moduleName/template/" . OPENBIZ_CLIENT_DEVICE . "/$templateFile");
        }

        foreach ($searchTpls as $tplFile) {
            if (file_exists($tplFile)) {
                return $tplFile;
            }
        }
        $errmsg = Resource::getMessage("UNABLE_TO_LOCATE_TEMPLATE_FILE", array($templateFile));
        trigger_error($errmsg, E_USER_ERROR);
        return null;
    }
public static function getTplFileWithPath($templateFile, $packageName)
    {
        //for not changing a lot things, the best injection point is added theme support here.
        $theme = Resource::getCurrentTheme();
        $themePath = $theme;    // Openbizx::$app->getConfiguration()->GetThemePath($theme);
        if ($themePath) {
            $templateRoot = OPENBIZ_THEME_PATH . "/" . $themePath . "/template";
        } else {
            $templateRoot = SMARTY_TPL_PATH;
        }

        $names = explode(".", $packageName);
        if (count($names) > 0) {
            $moduleName = $names[0];
        }
        $packagePath = str_replace('.', '/', $packageName);
        // check the leading char '@'
        $checkExtModule = true;
        if (strpos($packagePath, '@') === 0) {
            $packagePath = substr($packagePath, 1);
            $checkExtModule = false;
        }

        $searchTpls = array(
            OPENBIZ_APP_MODULE_PATH . "/$packagePath/template/$templateFile",
            dirname(OPENBIZ_APP_MODULE_PATH . "/$packagePath") . "/template/$templateFile",
            OPENBIZ_APP_MODULE_PATH . "/$moduleName/template/$templateFile",
            //OPENBIZ_APP_MODULE_PATH."/common/template/$templateFile",
            $templateRoot . "/$templateFile"
        );
        if ($checkExtModule && defined('MODULE_EX_PATH')) {
            array_unshift($searchTpls, MODULE_EX_PATH . "/$packagePath/template/$templateFile");
        }

        // device
        if (defined('OPENBIZ_CLIENT_DEVICE')) {
            array_unshift($searchTpls, OPENBIZ_APP_MODULE_PATH . "/$moduleName/template/" . OPENBIZ_CLIENT_DEVICE . "/$templateFile");
        }

        foreach ($searchTpls as $tplFile) {
            if (file_exists($tplFile)) {
                return $tplFile;
            }
        }
        $errmsg = Resource::getMessage("UNABLE_TO_LOCATE_TEMPLATE_FILE", array($templateFile));
        trigger_error($errmsg, E_USER_ERROR);
        return null;
    }
Get openbiz template file path by searching modules/package, /templates

@param string $className
@return string php library file path