<% ' +---------------------------------------------------------------------- ' | 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_AUTO '控制器包含文件,如 app/Runtime/Class/IndexAction.inc.asp Private inc_file Private Sub Class_Initialize inc_file = POP_MVC.appPath & "/Runtime/Class/" & POP_MVC.c & "Action.inc.asp" End Sub '自动化生成英文验证码 Public Property Get Verify( ) Verify = verify_( "popasp_verify" , "auto_verify.txt" ) End Property '自动化生成中文验证码 Public Property Get cnVerify( ) cnVerify = verify_( "popasp_cnverify" , "auto_cnverify.txt" ) End Property '下载的自动完成 '参数同POP_MVC.Download '自动写入下载的控制器方法 '自动完成下载链接的输出 '比如:">下载excel '使用该方法会使用一次md5,因此性能会降低大约8ms Public Property Get Download( arg ) Dim method_name,content,bReload,download_path,inc_content,file_path if not isArray( arg ) then download_path = chr(34) & arg & chr(34) file_path = POP_MVC.file.basename( arg ) else download_path = "Array( """ & join( arg , """,""" ) & """ )" file_path = POP_MVC.file.basename(arg(0)) if ubound( arg ) > 0 then file_path = arg(1) end if '方法名 method_name = "download_" & md5( download_path ) Download = URL__ & method_name If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成下载链接" & " " & "下载“" & file_path & "”" ) '如果方法体已经写入Runtime/Class/IndexAction.Class.asp中,则不再往下执行 if method_exists( POP_MVC.c & "Action" , method_name ) then Exit Property end if '是否重载 bReload = not ctrl_inc_method( method_name,inc_content ) '如果需要重载,则重新写入文件 if bReload then content = POP_MVC.file_get_contents( POP_MVC.mvc_dir & "Tpl/auto_download.txt" ) content = Replace( content, "METHOD_NAME" , method_name ) content = Replace( content, "DOWNLOAD_PATH" , download_path ) content = "<" & "%" & VbCrLf & inc_content & content & VbCrLf & "%" & ">" Call POP_MVC.file_put_contents( inc_file ,content ) If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "写入方法 " & method_name & " " & P_("pagetrace").readFile( inc_file , "查看文件" ) ) end if End Property '上传文件的自动完成 '自动生成上传文件popasp_upload_type.asp '自动完成上传链接的生成 '参数:字符串或数组 Array( input_name(一般与数据表中的字段名相同),文件类型 ) Public Property Get Upload( arg ) Dim upfile_name,srcname,content,upload_types,input_name,token_key,token_value upload_types = C_("UPLOAD_ALLOW_TYPES") '默认上传类型 input_name = "popasp_auto_upload" '默认 open_window_args = "width=500,height=240,left=200,top=50,status=yes,toolbar=no,menubar=no,location=no" if isArray( arg ) then input_name = arg( 0 ) if Ubound( arg ) > 0 then upload_types = arg(1) if Ubound( arg ) > 1 then open_window_args = arg(2) else input_name = arg end if '如果指定upload_types为空,则取配置 if trim(upload_types) = "" then upload_types = C_("UPLOAD_ALLOW_TYPES") end if '上传文件名auto_upload_types upfile_name = "./__popasp__/popasp_upload_" & POP_MVC.String.reg_replace( upload_types , "" , "\W" , "gi" ) & ".asp" token_key = POP_MVC.file.basename( Array(upfile_name ,1 ) ) token_value = Replace(timer() ,"." , "" ) '采用cookie进行token验证,更好的办法应该是session验证 Call P_( "cookie" ).set( token_key , token_value ) 'html代码 Upload = " 上传" If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成上传html " & Server.HtmlEncode( Upload ) ) '自动生成上传文件 srcname = POP_MVC.mvc_dir & "Tpl/auto_upload.txt" if Not POP_MVC.file.isExists( upfile_name ) then content = POP_MVC.file_get_contents( srcname ) content = Replace( content, "MVC_DIR" , "../" & POP_MVC.String.ltrim(POP_MVC.String.ltrim(POP_MVC.mvc_dir , "./" ) , ".\" ) ) content = Replace( content, "APP_PATH" , POP_MVC.realPath(POP_MVC.appPath) ) content = Replace( content, "UPLOAD_TYPES" , upload_types ) content = Replace( content, "INPUT_NAME" , input_name ) Call POP_MVC.file_put_contents( upfile_name , content ) If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成上传文件 " & upfile_name & P_("pagetrace").readFile( upfile_name , "查看文件" ) ) end if End Property '自动生成添加数据的html,界面粗糙,只可作为演示或者管理员临时修改数据使用 '使用: <%=P_("auto").htmlAdd(模型名)%> '该方法中使用了 checkAdd 、dbAdd ,形成了一套完整的可前后台验证的添加数据模块 '如果模型名与表名不一致,而又传入的是表名,则起不到前后台验证效果 '生成的代码大致如下: ' '
......
Public Property Get htmlAdd( model_name ) dim html,data,prikey,m set m = M_(model_name).db set data = m.getTableFields("") if not is_empty( m.prikey ) then data.remove( m.prikey ) end if html = Me.checkAdd( model_name ) html = html & "
" & vbcrlf html = html & "" & vbcrlf if typename( data ) = "Recordset" then set data = POP_MVC.rs2dict( data ) for each key in data html = html & vbTab & "" & vbcrlf html = html & vbTab & vbTab & "" & vbcrlf html = html & vbTab & vbTab & "" & vbcrlf html = html & vbTab & "" & vbcrlf next html = html & vbTab & "" & vbcrlf html = html & "
" & key & "
" & vbcrlf html = html & "
" & vbcrlf htmlAdd = html End Property '自动生成修改数据的html,界面粗糙,只可作为演示或者管理员临时修改数据使用 '使用: <%=P_("auto").htmlSave(表名或模型名)%> '该方法中使用了 checkSave 、auto、 dbSave,形成了一套完整的可前后台验证的添加数据模块 '如果模型名与表名不一致,而又传入的是表名,则起不到前后台验证效果 '浏览器地址栏必须传入id,如 save.asp?id=1,否则无法定位修改哪条记录 '在html中该方法使用js进行数据自动填充 '生成的代码大致如下: ' ' '
......
Public Function htmlSave( arg ) dim html,data,prikey,m,model_name,id id = POP_MVC.get("id") if not isArray( arg ) then model_name = arg else model_name = arg(0) if ubound( arg ) > 0 then id = arg(1) end if set m = M_(model_name).db set data = m.getTableFields("") if not is_empty( m.prikey ) then data.remove( m.prikey ) end if html = Me.checkSave( model_name ) html = html & Me.auto( model_name , id , "" ) html = html & "
" & vbcrlf html = html & "" & vbcrlf if typename( data ) = "Recordset" then set data = POP_MVC.rs2dict( data ) for each key in data html = html & vbTab & "" & vbcrlf html = html & vbTab & vbTab & "" & vbcrlf html = html & vbTab & vbTab & "" & vbcrlf html = html & vbTab & "" & vbcrlf next html = html & vbTab & "" & vbcrlf html = html & "
" & key & "
" & vbcrlf html = html & "" & vbcrlf html = html & "
" & vbcrlf html = html & "" & vbcrlf htmlSave = html End Function '将数据库中的数据以表格的形式显示,表格的最后一行是分页,表格的最右行是操作(修改|删除) '界面粗糙,只可作为演示或者管理员临时修改数据使用 '最好使用连贯操作db.where().field().page().htmlList( save_asp )来完成 public Function htmlList( ByRef rs , ByRef tableName , ByRef save_asp ) dim html,i,k1,k2,item,j,prikey dim dict,page page = P_( "POPASP_PAGE" )(rs).show set dict = P_("POPASP_TEMPLATE").rs2dict(rs) html = "" i = 0 for each k1 in dict set item = dict(k1) if i = 0 then html = html & VbCrLf & vbTab & "" html = html & VbCrLf & vbTab & vbTab for each k2 in item if isEmpty( prikey ) then prikey = k2 html = html & "" next html = html & "" html = html & VbCrLf & vbTab & "" end if if item(prikey) > 0 then if i mod 2 = 1 then html = html & VbCrLf & vbTab & "" else html = html & VbCrLf & vbTab & "" end if html = html & VbCrLf & vbTab & vbTab j = 0 for each k2 in item if j = 0 then html = html & "" else html = html & "" end if j = j + 1 next html = html & "" html = html & VbCrLf & vbTab & "" else html = html & VbCrLf & vbTab & "" end if i = i + 1 next html = html & VbCrLf & vbTab & "" set item = nothing html = html & VbCrLf & "
" & k2 & "操作
" & item(k2) & "" & item(k2) & "修改 | 删除
" & "该行数据已被删除" & "
" & page & "
" htmlList = html End Function '数据模型添加数据时的js前端验证 '自动写入控制器相关方法 '自动完成链接的输出 '使用了db.validate_,如果模型名与表名不一致,而又传入的是表名,则起不到前端验证效果 '比如:在<%=P_("auto").checkAdd( Array( 模型名 , 方法名 ) )%> '生成字符串为js,如 '在form表单中还须使用popasp_check
Public Property Get checkAdd( arg ) checkAdd = checkMethod( arg ,"popasp_js_check_add" , "auto_checkAdd.txt" ) End Property '数据模型修改数据时的js前端验证 '自动写入控制器相关方法 '自动完成链接的输出 '使用了db.validate_,如果模型名与表名不一致,而又传入的是表名,则起不到前端验证效果 '比如:在<%=P_("auto").checkSave( 模型名 , 方法名 )%> '生成字符串为js,如 '在form表单中还须使用popasp_check Public Property Get checkSave( arg ) checkSave = checkMethod( arg ,"popasp_js_check_modify" , "auto_checkSave.txt" ) End Property 'js填充表单 '自动写入控制器相关方法 '自动完成链接的输出 '参数说明:model_name为表名或模型名,id为数据表中某条记录的主键值,fieldRev为排除字段 'fieldRev相当于db.fieldRev(排除字段)中的参数,取值为字符串,如"password,other_field" '使用:<%=P_("auto").auto( 表名或模型名, id , 排除的字段 )%> 若的id一般用POP_MVC.get("id")获取 '生成的js代码为: '在表单的hmtl下面还需要写入js代码 Public Function [auto]( model_name , id , fieldRev ) Dim method_name,content,bReload,inc_content method_name = "popasp_js_auto" [auto] = "" & VbCrLf If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成JS代码 " & Server.HtmlEncode([auto]) ) '如果方法体已经写入Runtime/Class/IndexAction.Class.asp中,则不再往下执行 if method_exists( POP_MVC.c & "Action" , method_name ) then Exit Function end if '是否重载 bReload = not ctrl_inc_method( method_name,inc_content ) '如果需要重载,则重新写入文件 if bReload then content = POP_MVC.file_get_contents( POP_MVC.mvc_dir & "Tpl/auto_auto.txt" ) content = Replace( content, "METHOD_NAME" , method_name ) content = Replace( content, "MODEL_NAME" , model_name ) content = Replace( content, "FIELDREV" , fieldRev ) content = "<" & "%" & VbCrLf & inc_content & content & VbCrLf & "%" & ">" Call POP_MVC.file_put_contents( inc_file ,content ) If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "写入方法 " & method_name & " " & P_("pagetrace").readFile( inc_file , "查看文件" ) ) end if End Function '数据模型添加的自动完成 '自动写入控制器相关方法 '参数:字符串或数组 Array( 模型名 , 控制器的方法名 ) ,控制器的方法名默认popasp_do_add,自定义时不能与其他冲突 '使用了db.create,如果模型名与表名不一致,而又传入的是表名,则db.create永远为真 '自动完成链接的输出 '比如:"> Public Property Get dbAdd( arg ) dbAdd = dbAddOrDbSave( arg ,"popasp_do_add" , "auto_dbAdd.txt" ) End Property '数据模型修改的自动完成 '注意:表单提交数据必须含主键ID '参数:字符串或数组 Array( 模型名 , 控制器的方法名 ) ,控制器的方法名默认popasp_do_modify,自定义时不能与其他冲突 '使用了db.create,如果模型名与表名不一致,而又传入的是表名,则db.create永远为真 '自动写入控制器相关方法 '自动完成链接的输出 '比如:"> Public Property Get dbSave( arg ) dbSave = dbAddOrDbSave( arg ,"popasp_do_modify" , "auto_dbSave.txt" ) End Property '数据模型删除一行或多行记录的操作 '数据模型删除的自动完成,使用了db.Remove '自动写入控制器相关方法 '自动完成链接的输出 '比如:" onclick="javascript: return confirm('您确信要删除吗?删除之后,将无法恢复!')">删除 Public Function dbRemove( model_name , id ) Dim method_name,content,bReload,inc_content method_name = "popasp_remove" if isArray( id ) then dbRemove = URL__ & method_name & "&id=" & join(id,",") else dbRemove = URL__ & method_name & "&id=" & id end if If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成链接 " & dbRemove ) '如果方法体已经写入Runtime/Class/IndexAction.Class.asp中,则不再往下执行 if method_exists( POP_MVC.c & "Action" , method_name ) then Exit Function end if '是否重载 bReload = not ctrl_inc_method( method_name,inc_content ) '如果需要重载,则重新写入文件 if bReload then content = POP_MVC.file_get_contents( POP_MVC.mvc_dir & "Tpl/auto_dbRemove.txt" ) content = Replace( content, "METHOD_NAME" , method_name ) content = Replace( content, "MODEL_NAME" , model_name ) content = "<" & "%" & VbCrLf & inc_content & content & VbCrLf & "%" & ">" Call POP_MVC.file_put_contents( inc_file ,content ) If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "写入方法 " & method_name & " " & P_("pagetrace").readFile( inc_file , "查看文件" ) ) end if End Function '数据模型取反的自动完成,使用了db.setNot '自动写入控制器相关方法 '自动完成链接的输出 '比如:" >值取反 Public Function dbNot( model_name , id , field_name ) Dim method_name,content,bReload,inc_content method_name = "popasp_not" if isArray( id ) then dbNot = URL__ & method_name & "&field=" & field_name & "&id=" & join(id,",") else dbNot = URL__ & method_name & "&field=" & field_name & "&id=" & id end if If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成链接 " & dbNot ) '如果方法体已经写入Runtime/Class/IndexAction.Class.asp中,则不再往下执行 if method_exists( POP_MVC.c & "Action" , method_name ) then Exit Function end if '是否重载 bReload = not ctrl_inc_method( method_name,inc_content ) '如果需要重载,则重新写入文件 if bReload then content = POP_MVC.file_get_contents( POP_MVC.mvc_dir & "Tpl/auto_dbNot.txt" ) content = Replace( content, "METHOD_NAME" , method_name ) content = Replace( content, "MODEL_NAME" , model_name ) content = "<" & "%" & VbCrLf & inc_content & content & VbCrLf & "%" & ">" Call POP_MVC.file_put_contents( inc_file ,content ) If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "写入方法 " & method_name & " " & P_("pagetrace").readFile( inc_file , "查看文件" ) ) end if End Function '数据模型设置值的自动完成,使用了db.setField,并只能设置一个字段的值 '自动写入控制器相关方法 '自动完成链接的输出 '比如:" >设置值 Public Function dbSet( model_name , id , field_name , field_value ) dbSet = dbIncDecSet( model_name , id , field_name , field_value , "auto_dbSet.txt" , "popasp_set_field" ) End Function '数据模型自增长的自动完成,使用了db.setInc '自动写入控制器相关方法 '自动完成链接的输出 '比如:" >自增 Public Function dbInc( model_name , id , field_name , inc_value ) dbInc = dbIncDecSet( model_name , id , field_name , inc_value , "auto_dbInc.txt" , "popasp_set_inc" ) End Function '数据模型自减小的自动完成,使用了db.setDec '自动写入控制器相关方法 '自动完成链接的输出 '比如:" >自减 Public Function dbDec( model_name , id , field_name , dec_value ) dbDec = dbIncDecSet( model_name , id , field_name , dec_value , "auto_dbDec.txt" , "popasp_set_dec" ) End Function '数据模型值设置为1的自动完成,使用了db.setField '自动写入控制器相关方法 '自动完成链接的输出 '比如:" >值设为1 Public Function db1( model_name,id,field_name ) db1 = db01( model_name , id , field_name , 1 , "popasp_set_1" ) End Function '数据模型值设置为0的自动完成,使用了db.setField '自动写入控制器相关方法 '自动完成链接的输出 '比如:" >值设为0 Public Function db0( model_name,id,field_name ) db0 = db01( model_name , id , field_name , 0 , "popasp_set_0" ) End Function Private Function db01( model_name , id , field_name , field_value , method_name ) Dim content,bReload,inc_content if isArray( id ) then db01 = URL__ & method_name & "&field=" & field_name & "&id=" & join(id,",") else db01 = URL__ & method_name & "&field=" & field_name & "&id=" & id end if If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成链接 " & db01 ) '如果方法体已经写入Runtime/Class/IndexAction.Class.asp中,则不再往下执行 if method_exists( POP_MVC.c & "Action" , method_name ) then Exit Function end if '是否重载 bReload = not ctrl_inc_method( method_name,inc_content ) '如果需要重载,则重新写入文件 if bReload then content = POP_MVC.file_get_contents( POP_MVC.mvc_dir & "Tpl/auto_db01.txt" ) content = Replace( content, "METHOD_NAME" , method_name ) content = Replace( content, "MODEL_NAME" , model_name ) content = Replace( content, "FIELD_VALUE" , field_value ) content = "<" & "%" & VbCrLf & inc_content & content & VbCrLf & "%" & ">" Call POP_MVC.file_put_contents( inc_file ,content ) If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "写入方法 " & method_name & " " & P_("pagetrace").readFile( inc_file , "查看文件" ) ) end if End Function Private Function dbIncDecSet( model_name , id , field_name , value, srcname , method_name ) Dim content,bReload,inc_content if isArray( id ) then dbIncDecSet = URL__ & method_name & "&field=" & field_name & "&value=" & value & "&id=" & join(id,",") else dbIncDecSet = URL__ & method_name & "&field=" & field_name & "&value=" & value & "&id=" & id end if If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成链接 " & dbIncDecSet ) '如果方法体已经写入Runtime/Class/IndexAction.Class.asp中,则不再往下执行 if method_exists( POP_MVC.c & "Action" , method_name ) then Exit Function end if '是否重载 bReload = not ctrl_inc_method( method_name,inc_content ) '如果需要重载,则重新写入文件 if bReload then content = POP_MVC.file_get_contents( POP_MVC.mvc_dir & "Tpl/" & srcname ) content = Replace( content, "METHOD_NAME" , method_name ) content = Replace( content, "MODEL_NAME" , model_name ) content = "<" & "%" & VbCrLf & inc_content & content & VbCrLf & "%" & ">" Call POP_MVC.file_put_contents( inc_file ,content ) If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "写入方法 " & method_name & " " & P_("pagetrace").readFile( inc_file , "查看文件" ) ) else end if End Function '数据模型增加/修改的自动完成 Private Property Get dbAddOrDbSave( arg , default_method , srcname ) Dim model_name,method_name,content,bReload,inc_content if not isArray( arg ) then model_name = arg else model_name = arg(0) if ubound( arg ) > 0 then method_name = arg(1) end if if method_name = "" then method_name = default_method dbAddOrDbSave = URL__ & method_name If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成链接 " & dbAddOrDbSave ) '如果方法体已经写入Runtime/Class/IndexAction.Class.asp中,则不再往下执行 if method_exists( POP_MVC.c & "Action" , method_name ) then Exit Property end if '是否重载 bReload = not ctrl_inc_method( method_name,inc_content ) '如果需要重载,则重新写入文件 if bReload then content = POP_MVC.file_get_contents( POP_MVC.mvc_dir & "Tpl/" & srcname ) content = Replace( content, "METHOD_NAME" , method_name ) content = Replace( content, "MODEL_NAME" , model_name ) content = "<" & "%" & VbCrLf & inc_content & content & VbCrLf & "%" & ">" Call POP_MVC.file_put_contents( inc_file ,content ) If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "写入方法 " & method_name & " " & P_("pagetrace").readFile( inc_file , "查看文件" ) ) end if End Property '用于checkAdd与checkSave中 Private Property Get checkMethod( arg , default_method , srcname ) Dim model_name,method_name,content,bReload,inc_content if not isArray( arg ) then model_name = arg else model_name = arg(0) if ubound( arg ) > 0 then method_name = arg(1) end if if method_name = "" then method_name = default_method checkMethod = "" & VbCrLf If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成JS代码 " & Server.HtmlEncode(checkMethod) ) '如果方法体已经写入Runtime/Class/IndexAction.Class.asp中,则不再往下执行 if method_exists( POP_MVC.c & "Action" , method_name ) then Exit Property end if '是否重载 bReload = not ctrl_inc_method( method_name,inc_content ) '如果需要重载,则重新写入文件 if bReload then content = POP_MVC.file_get_contents( POP_MVC.mvc_dir & "Tpl/" & srcname ) content = Replace( content, "METHOD_NAME" , method_name ) content = Replace( content, "MODEL_NAME" , model_name ) content = "<" & "%" & VbCrLf & inc_content & content & VbCrLf & "%" & ">" Call POP_MVC.file_put_contents( inc_file ,content ) If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "写入方法 " & method_name & " " & P_("pagetrace").readFile( inc_file , "查看文件" ) ) end if End Property '判断类似app/Runtime/Class/IndexAction.inc.asp这样的文件中是否含有某个方法,比如popasp_js_auto Private Function ctrl_inc_method( ByRef method_name,ByRef inc_content ) if not POP_MVC.file.isExists( inc_file ) then ctrl_inc_method = false inc_content = "" Exit Function end if '取得inc文件内容 inc_content = POP_MVC.asp_get_contents(inc_file) & VbCrLf '如果不存在该方法 if not POP_MVC.String.reg_test( inc_content , "^\s*(Public\s+)?(Sub|Function|Property)\s+\[?" & method_name & "\]?\s*" , "gim" ) then ctrl_inc_method = false Exit Function end if ctrl_inc_method = true End Function Private Function verify_( method_name , srcname ) Dim content,bReload,inc_content,url,input_name input_name = C_( "SESSION_VERIFY" ) url = URL__ & method_name verify_ = " 验证码" If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "生成链接 " & verify_ ) '如果方法体已经写入Runtime/Class/IndexAction.Class.asp中,则不再往下执行 if method_exists( POP_MVC.c & "Action" , method_name ) then Exit Function end if '是否重载 bReload = not ctrl_inc_method( method_name,inc_content ) '如果需要重载,则重新写入文件 if bReload then content = POP_MVC.file_get_contents( POP_MVC.mvc_dir & "Tpl/" & srcname ) content = Replace( content, "METHOD_NAME" , method_name ) content = "<" & "%" & VbCrLf & inc_content & content & VbCrLf & "%" & ">" Call POP_MVC.file_put_contents( inc_file ,content ) If Not is_empty( C_( "APP_DEBUG" ) ) Then POP_MVC.pushAuto( "写入方法 " & method_name & " " & P_("pagetrace").readFile( inc_file , "查看文件" ) ) end if End Function End Class %>