iwebshop 常用类库使用总结

IFilter : 过滤库           

语法 :

1 IFilter::act($str,$type,$limitLen);
View Code
     参 数                                     描述         
   str 参数:string | array , 必需,被过滤的字符串,多个字符串可用数组形式
  type      参数:string , 可选,默认值:string, 可选值(int, float, string, text, bool, url,filename,strict)
 limitLen  参数:int,被输入的最大字符个数 , 默认不限制

 

IReq : 处理 GET,POST 数据

语法 :

1 //获取键为$key的 $_GET 和 $_POST 传送方式的数据
2 IReq::get($key, $type=false);
3 
4 //设置键为$key 的$_GET 或者 $_POST 的变量值
5 IReq::set($key, $value, $type='get');
View Code
   参数                                 描述    

  key        

参数:string , 必需, \$_GET 或\$_POST 的键
  type   

参数:string , 默认值:false,传送方式:(先get后post); 可选:,get:get方式; post:post方式

value

参数:value ,设置的值

 

 ISafe :安全机制session或者cookie数据操作

语法:

 1 /**
 2  * @action  get 获取cookie || session 的值
 3  * @action  set 设置cookie || session 的值
 4  * @action  clear  删除某个cookie || session 的值
 5  * @action  clearAll  删除全部cookie || session 的值
 6  * @action  getSafeClass  获得cookie || session 对象,也就是获得cookie || session所以值
 7  */
 8 ISafe::get('visit',$type='');
 9 ISafe::set('visit',$visit,$type='');
10 ISafe::clear($name = null,$type = '');
11 ISafe::clearAll($type = '');
12 ISafe::getSafeClass($type = '');
View Code
   参数                                 描述    

  key        

参数:string , 必需, session 或cookie 的键,名称
  type   

参数:string , 默认值:'',值为session 或cookie

value

参数:value ,session 或cookie的值

 

以上是iwebshop较为常用的类库,想知道更多内容可以进入 \iwebshop\lib\core\util 目录下深入了解

posted @ 2015-12-07 10:53  会飞的鸟儿  阅读(539)  评论(0)    收藏  举报