我使用PHPStorm,如果它有幫助的方法,我也在Mac OSX系統上。Laravel 4有難以跟蹤方法的位置
我們已經在我們下面的一行代碼:
$config = Config::get('regions');
首先,我想找到的class Config
位置。好了,這是不行的..
print_r(get_class(Config));
所以我這樣做:
$test = new Config; //works
print_r(get_class(Config));
這給了我:
\Illuminate\Support\Facades\Config
這又是很短:
<?php namespace Illuminate\Support\Facades;
/**
* @see \Illuminate\Config\Repository
*/
class Config extends Facade {
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor() { return 'config'; }
}
所以..我看在Facade
,和噸這裏是否get()
方法。
在代碼中搜索function get(..
,有100多個這樣的實例。
如何在世界上我可以找到這個具體的get()
方法?
爲什麼你需要它?此方法只是從app/config文件夾中的文件regions.php返回內容。 –
雖然我很欣賞貢獻,但這不是我問的問題。在某些情況下,未來某些開發人員(如我自己)可能想知道如何找到特定方法或其他特定方法。 –