Heim  >  Artikel  >  Backend-Entwicklung  >  thinkphp整合 个推

thinkphp整合 个推

WBOY
WBOYOriginal
2016-08-08 09:06:561695Durchsuche

thinkphp在使用时 将下载的个推sdk放入vendor目录下 怎么引用到项目中
vendor('iGT.IGt.Push');
这样为什么引用不进来

thinkphp整合 个推

回复内容:

thinkphp在使用时 将下载的个推sdk放入vendor目录下 怎么引用到项目中
vendor('iGT.IGt.Push');
这样为什么引用不进来

thinkphp整合 个推

<code>vendor("IGT.IGT", '' ,'.Push.php');</code>

你的其实是加载 Vendor/iGT/IGT/Push.php 文件

试下修改文件后缀名的方法

<code>vendor('iGT.IGt', dirname(__FILE__), '.Push.php');</code>

或者修改文件名,文件名中不要出现 .

建议用命名空间的方式 引入 class,不建议用vendor 函数

new \Vendor\iGT\IGT\Push(); 这样不行吗

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn