一個類文件時namespace的庫方式
通過下面的方式引入類,報錯 Class Not Found:
namespace frontend\block\customer\account; use Yii; use frontend\block\Blockbase; //use yii\base\Model; //use backend\models\helper\Base.php use frontend\models\core\Request; use frontend\models\core\Customer; use frontend\models\core\User; use frontend\models\core\Url; use frontend\models\core\Func; use frontend\models\core\Email; use frontend\models\core\Help; use frontend\models\core\Session; use frontend\models\core\Config; use frontend\models\core\Store; use frontend\models\core\Message; use frontend\models\core\Date; use frontend\models\core\Mongodb; use Facebook\FacebookSession; use Facebook\FacebookRedirectLoginHelper; use Facebook\FacebookRequest; use Facebook\FacebookResponse; use Facebook\FacebookSDKException; use Facebook\FacebookRequestException; use Facebook\FacebookAuthorizationException; use Facebook\GraphObject; use Facebook\Entities\AccessToken; use Facebook\HttpClients\FacebookCurlHttpClient; use Facebook\HttpClients\FacebookHttpable; class Login extends Blockbase { public function getGoogleLoginUrl(){ $lib_google_base = Yii::getAlias("@common/lib/google"); //echo $lib_google_base.'/Social.php';exit; $lib_google_base = Yii::getAlias("@common/lib/google"); include $lib_google_base.'/Social.php'; $Social_obj= new Social(); $url = $Social_obj->google(); return $url; } }
$Social_obj= new \Social();