ASP 高级模板引擎实现类

2019-04-01 19:06:30王振洲


                        If Int(Len(c_PageStr)) > 0 Then
                            ReplacePageStr = Array("<page:" & Trim(PageID) & "/>", c_PageStr)
                        Else
                            ReplacePageStr = Array("<page:" & Trim(PageID) & "/>", "")
                        End If
                    Else
                        TextLeft = 0
                        TextRight = UBound(Text, 2)
                    End If

                    For i = TextLeft To TextRight
                        TempText = TempText & ItemReSec(i, SubMatchText, Text)        ' 加载模板内容
                    Next
                End If
            Next
            ItemTemplate = TempText
        Else
            ItemTemplate = ""
        End If
        Set Matches = Nothing
    End Function

    ' ***************************************
    '    替换模板字符串
    ' ***************************************
    Private Function ItemReSec(ByVal i, ByVal Text, ByVal Arrays)
        Dim Matches, SubMatches