5ucms论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 6450|回复: 0

[2.x] 3、POPASP快速入门第三课 使用var_export方法快速查看变量

[复制链接]

670

主题

785

帖子

8228

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
8228
发表于 2019-4-1 14:40:02 | 显示全部楼层 |阅读模式
POPASP快速入门第三课 使用var_export方法快速查看变量

因为asp的response.write不能输出数组类数据,这东西类似万能输出,有点像PHP的var_dump,如果你只记得dump,那你是学THINKPHP的^_^

  1. <!--#include file="../popasp_2.0/popasp.asp"-->
  2. <%
  3. const APP_PATH = "./home"
  4. POP_MVC.run
  5. Call A_("Index/index")
  6. %>
  7. <strong><%=V_("TIP")%></strong>
复制代码


IndexAction.class.asp
  1. <%
  2. ' 本类由系统自动生成,仅供测试用途
  3. Class IndexAction
  4.     public Sub index()
  5.                 'that.assign "TIP","hello popasp mvc"
  6.                 '使用Response.write方法就有点浪费时间了
  7.                 dim temp,key,arr,dict
  8.                 temp = "hello mvc"
  9.                 'Response.write temp
  10.                 'var_export temp
  11.                
  12.                 temp = now()
  13.                 'var_export temp '2017/1/12 22:22:41
  14.                
  15.                 'Request.ServerVariables
  16.                 'Response.write typename(Request.ServerVariables) 'IRequestDictionary
  17.                 'for each key in Request.ServerVariables
  18.                 '        Response.write  key & ":" & Request.ServerVariables(key) & "<br />"
  19.                 'next
  20.                 'var_export Request.ServerVariables
  21.                
  22.                 arr = array(1,2,3,4,5)
  23.                 'var_export arr '[ 1, 2, 3, 4, 5 ]
  24.                
  25.                 'POP_MVC是POPASP_MVC类的实例,它是一个对象
  26.                 'var_export POP_MVC '由四部分组成private_vars、public_vars、private_method、public_method
  27.                
  28.                 'that只能在action类中使用,它是POPASP_CONTROLLER类的一个实例化。
  29.                 'var_export that
  30.                
  31.                 '它还可以输出Recordset类型的变量
  32.                
  33.                 'Dictionary对象在VBScript语言中是最接近PHP语言的数组了。
  34.                 set dict = D_
  35.                 dict("a") = 111
  36.                 dict("b") = 222
  37.                 'var_export dict        '{ "a": 111, "b": 222 }
  38.                
  39.                 var_export Me
  40.     end Sub
  41. End Class
  42. %>
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|5ucms.com

GMT+8, 2024-3-29 21:19 , Processed in 0.250000 second(s), 30 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表