Cmfcmf\OpenWeatherMap::setApiKey PHP Method

setApiKey() public method

Sets the API Key.
public setApiKey ( string $apiKey )
$apiKey string API key for the OpenWeatherMap account.
    public function setApiKey($apiKey)
    {
        $this->apiKey = $apiKey;
    }

Usage Example

コード例 #1
0
 protected function setUp()
 {
     // Load the app configuration
     $ini = parse_ini_file(__DIR__ . '/ApiKey.ini');
     $apiKey = $ini['api_key'];
     $this->owm = new OpenWeatherMap();
     $this->owm->setApiKey($apiKey);
 }
All Usage Examples Of Cmfcmf\OpenWeatherMap::setApiKey