BUG继承类
1.簡述
子類繼承父類后不能直接使用父類use的類!!!!
如果在子類中還要再使用? 應該再次use下!!!!!
2.代碼
<?php namespace app\modules\weixin\controllers;use Yii; use yii\log\FileTarget; use app\common\components\BaseWebController;class MsgController extends BaseWebController {public function actionIndex(){if (!$this->checkSignature()) {return "error signature";}if (array_key_exists("echostr",$_GET) && $_GET['echostr'] ) {return $_GET['echostr'];}$xml_data = file_get_contents("php://input");$this->record_log( "[xml_data]:". $xml_data );if (!$xml_data){return "error";}else{}}3.分析
父類中有了use Yii;
在子類中還需要再次使用use Yii;
!!!!
總結
- 上一篇: PHP的simplexml_load_f
- 下一篇: jQuery中的for循环var与let