Pagekit\Dashboard\Controller\DashboardController::weatherAction PHP Метод

weatherAction() публичный Метод

public weatherAction ( $data, $action )
    public function weatherAction($data, $action)
    {
        $url = $this->api;
        if ($action === 'weather') {
            $url .= '/weather';
        } elseif ($action === 'find') {
            $url .= '/find';
        }
        $data['APPID'] = $this->apiKey;
        $url .= '?' . http_build_query($data);
        return App::response(file_get_contents($url), 200, ['Content-Type' => 'application/json']);
    }