Home >Backend Development >PHP Tutorial >thinkphp vender导入第三方类库的问题

thinkphp vender导入第三方类库的问题

WBOY
WBOYOriginal
2016-06-06 20:47:171597browse

第三方类库文件:F:\xampp\htdocs\Cms\Extend\Vendor\snoopy.php
自定义类如下:

<code>class Sms extends UserAction{
    vendor('Snoopy');
    public function sms(){
    .....
    }
}
</code>

运行是报错如下:

<code>syntax error, unexpected 'vendor' (T_STRING), expecting function (T_FUNCTION) 
</code>

请问是什么原因呢,我的写法是不是不对啊,怎么改,先谢谢了!

回复内容:

第三方类库文件:F:\xampp\htdocs\Cms\Extend\Vendor\snoopy.php
自定义类如下:

<code>class Sms extends UserAction{
    vendor('Snoopy');
    public function sms(){
    .....
    }
}
</code>

运行是报错如下:

<code>syntax error, unexpected 'vendor' (T_STRING), expecting function (T_FUNCTION) 
</code>

请问是什么原因呢,我的写法是不是不对啊,怎么改,先谢谢了!

<code class="lang-php">vendor('Snoopy');
class Sms extends UserAction{}
</code>

<code class="lang-php">class Sms extends UserAction{

    public function sms(){
        vendor('Snoopy');
    }
}
</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn