我是新来的Laravel,我试图了解它是如何工作的。我已经按照定义设置了这个库。Laravel Twitter图书馆 - 哪里是静态函数getUserTimeline()
https://github.com/thujohn/twitter-l4
例子完美的作品时,我定义只有Twitter的使用;显示如下
use Stream;
use Twitter;
class GoController extends \BaseController{
function go($id){
return Twitter::getUserTimeline(array('screen_name' => 'thujohn', 'count' => 20, 'format' => 'json'));
}
}
但它使用Thujohn \ Twitter \ Twitter时会引发此错误;
use Stream;
use Thujohn\Twitter\Twitter;
class GoController extends \BaseController{
function go($id){
return Twitter::getUserTimeline(array('screen_name' => 'thujohn', 'count' => 20, 'format' => 'json'));
}
}
非静态方法Thujohn \微博\ Twitter的:: getUserTimeline()应该 不能静态调用,假设$这种在不兼容的情况下
所以,我无法理解为什么我不能使用第二种形式?
你能告诉我一个例子如何加载一个非静态类静态? – fobus 2014-12-05 20:54:43