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

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

WBOY
Release: 2016-06-06 20:47:17
Original
1596 people have browsed it

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

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

运行是报错如下:

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

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

回复内容:

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

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

运行是报错如下:

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

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

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

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

    public function sms(){
        vendor('Snoopy');
    }
}
</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template