
一、常量
- const VS = '1.0.0';//常量名称要大写字母
 - const ED = 'utf-8';//常量常量名称要大写字母
 
 
使用:
dump(self::VS);exit; 
二、变量
- class LebaifenPay
 - {
 -     
 -     public $lbfpay_conf;//1.先定义
 -     
 -     public function __construct()
 -     {
 -     	//初始化,取得微信支付参数
 -     	$this->lbfpay_conf = system_cofing();//2.再赋值
 -     }
 -  
 -     /**
 -      * 创建
 -      *
 -      * @param $data
 -      * @return string
 -      * @throws ErrorException
 -      */
 -     public function buildRequestForm($data)
 -     {
 -         //3.引用
 -         $system_website=$this->lbfpay_conf['system_website'];
 -         dump($system_website);exit;
 
 
三、调用方法
要调用上面这种组成的LebaifenPay类
3.1 这种方法是调用不了的。这种是静态(::对应static)
$result = \lfqpay\LebaifenPay::buildRequestForm($baiduparams);
public static function buildRequestForm($params)
3.2 这种方法才可以,要实例化
            $result = new \lfqpay\LebaifenPay;
             $result->buildRequestForm($params);
或者这样引用
- <?php
 - class Test
 - {
 -     public $a=null;
 -     function __construct()
 -     {
 -         $this->a = 10;
 -     }
 -     static function test1(){
 -         $a=new self();
 -         echo $a->a;
 -         //echo $obj->a;
 -     }
 -  
 - }
 - (new Test)->test1();
 - ?>
 
 
                
                

















