0
I want to implement twillio API in Yii2.
On submit form SMS should be sent.
I placed all twillio library code in advanced yii2 app in :
rr.lcl/library/twilli_lib/
rr.lcl是我的根文件夾(高級)如何使用外部的PHP類文件中Yii2行動
Here is my function:
public function actionSendtestsms($id) {
require($_SERVER['DOCUMENT_ROOT'].'/rr.lcl/library/twilio-php-master/Services/Twilio.php')
$client = new Services_Twilio($account_sid, $auth_token);
}
如何包括Yii2控制器功能外CALSS PHP文件。
感謝您的重播,但問題已通過Curl解決 – prad 2015-06-16 09:19:02
請確保添加反斜槓或它將查找控制器,例如$ client = new \ Services_Twilio($ account_sid,$ auth_token); – 2016-01-09 21:06:53