<% ' +---------------------------------------------------------------------- ' | POPASP [ ASP MVC ] ' +---------------------------------------------------------------------- ' | Copyright (c) 2016 http://popasp.com All rights reserved. ' +---------------------------------------------------------------------- ' | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) ' +---------------------------------------------------------------------- ' | Author: popasp <1737025626@qq.com> ' +---------------------------------------------------------------------- Class POPASP_URL private ctrlName private actionName Public Sub setConfig( attr,value ) if isNumeric(value) then Execute attr & " = " & value else Execute attr & " = """ & value & """" end if end sub '获取控制器名称 Function get_ctrl_name ( ) dim c if isEmpty( ctrlName ) then c = POP_MVC.Get( C_("VAR_MODULE") ) if not isEmpty(c) Then c = trim( CStr(c) ) End if if isEmpty(c) Then c = C_("DEFAULT_MODULE") else c = POP_MVC.String.UCFirst(LCase(c)) end if get_ctrl_name = c else get_ctrl_name = ctrlName end if End Function '获取操作方法名称 Function get_action_name ( ) dim a if isEmpty( actionName ) then a = POP_MVC.Get( C_("VAR_ACTION") ) if not isEmpty(a) Then a = trim( CStr(a) ) End if if isEmpty(a) Then a = C_("DEFAULT_ACTION") end if get_action_name = a else get_action_name = actionName end if End Function Sub set_tmpl_config dim script_name,self_ dim c,a c = get_ctrl_name() a = get_action_name() '设置模板替换变量 script_name = Request.ServerVariables("SCRIPT_NAME") Execute("const ROOT__ = """ & POP_MVC.root_path & """") Execute("const APP__ = """ & script_name & """") Execute("const QUERY__ = """ & Replace(Request.ServerVariables("QUERY_STRING") , chr(34) , chr(34) & chr(34) ) & """") self_= APP__ if Request.ServerVariables("QUERY_STRING") <> "" then self_ = self_ & "?" & Request.ServerVariables("QUERY_STRING") end if Execute("const SELF__ = """ & Replace(self_ , chr(34) , chr(34) & chr(34) ) & """") end sub End Class %>