


yii2 php namespace 引出第三方非namespace库文件时候,报错:Class not found 的解决
yii2 php namespace 引入第三方非namespace库文件时候,报错:Class not found 的解决
一个类文件时namespace的库方式
通过下面的方式引入类,报错 Class Not Found:
namespace frontend\block\customer\account;use Yii;use frontend\block\Blockbase;//use yii\base\Model;//use backend\models\helper\Base.phpuse 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(); 改成:
$Social_obj= new \Social();
也就是加入一个反斜杠,哈哈,折腾了我1个小时。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Facebook is a globally renowned social media platform that provides users with a platform to connect and communicate. Founded in 2004, it was founded by Mark Zuckerberg and others. It is an online social network where users can share information, photos and videos with and interact with friends, family and colleagues. Its influence is not limited to individual users, but also extends to businesses and news fields.

Microsoft's Windows 11 2022 Update (22H2) enables CoreIsolation's memory integrity protection by default. However, if you are running an older version of the operating system, such as Windows 11 2022 Update (22H1), you will need to turn this feature on manually. Turn on CoreIsolation's Memory Integrity feature in Windows 11 For users who don't know about Core Isolation, it's a security process designed to protect basic core activities on Windows from malicious programs by isolating them in memory. This process, combined with the memory integrity feature, ensures

Core has two meanings in computers: 1. The core, also known as the core, is the most important component of the CPU. All calculations, accepting storage commands, and processing data of the CPU are performed by the core; 2. Core, core is Intel's processor Name, Core is the processor brand launched by Intel after the Pentium processor. It has currently released twelfth generation Core processors.

Facebook means an American Internet company, and also refers to the social network service website developed by the company; Facebook was founded on February 4, 2004. It is a world-famous social communication application that users can use Communicate with people around the world.
![How to Fix Processor Thermal Trip Error in Windows 11/10 [Fix]](https://img.php.cn/upload/article/000/000/164/168169038621890.png?x-oss-process=image/resize,m_fill,h_207,w_330)
Most of the devices, such as laptops and desktops, have been heavily used by young gamers and coders for a long time. The system sometimes hangs due to application overload. This forces users to shut down their systems. This mainly happens to players who install and play heavy games. When the system tries to boot after force shutdown, it throws an error on a black screen as shown below: Below are the warnings detected during this boot. These can be viewed in the settings on the event log page. Warning: Processor thermal trip. Press any key to continue. ..These types of warning messages are always thrown when the processor temperature of a desktop or laptop exceeds its threshold temperature. Listed below are the reasons why this happens on Windows systems. Many heavy applications are in

Recently, the author discovered a deep link vulnerability in the Facebook Android APP. Using this vulnerability, the Facebook Android APP installed on the user's mobile phone can be converted into a backdoor program (Backdoor) to achieve backdooring. In addition, this vulnerability can also be used to repackage the Facebook APP and send it to specific target victims for installation and use. Let’s take a look at the author’s discovery process of this vulnerability, and how to construct it through Payload and finally transform it into a security risk in the actual production environment of Facebook APP. When I usually do public testing when discovering vulnerabilities, I will first carefully understand the application mechanism of the target system. In my last blog, I have shared how to parse Face

Text Facebook embedded video player API is a client function provided by the JavaScript version of FacebookSDK. You can play Facebook videos on your website. To start using it, first introduce FacebookSDK and encapsulate it into a component FacebookPlayerimport{onMounted, onBeforeUnmount} from "vue"; constprops=defineProps({id:{type:String,default:""},src:{type:String,require

When trying to make a video call using Facebook Messenger in the browser, sometimes it complains about a hardware access error. An error pops up saying "You need to allow microphone and camera access for video calls on your PC". This could be because you may want to enable camera and microphone access on your computer, or because of outdated drivers, conflicting devices, site permission issues, etc. In this article, we have different solutions to resolve this error. let's start! Method 1: Allow desktop apps to access your camera and microphone Step 1: Use Windows + I keys together to open Windows Settings Step 2: Click on Privacy Step 3: On the left, scroll down and click Microphone Step 4:
