0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

環境

イメージ画面

スクリーンショット 2025-07-11 16.23.16.png

スクリーンショット 2025-07-11 16.23.25.png

概要

都市名(主に日本の都道府県)を入力すると、その地域の天気情報を取得して表示する。
取得もとは、上記APIへ情報を投げて引っ張ってきている。

実際のコード

Githubにあげたので、以下から確認できます。
https://github.com/ngttmcr71106/codeigniter4-weather

Localで開発する時

app直下にCodeIgniterファイルを配置する。
→ここが意外と理解しきれていなくて、Localで開発した時に、app/public直下でCodeIgniterプロジェクトを立ち上げて動かなかった記憶がある。

APIに関して

上記のイメージ写真では、

  • 気温
  • 天気
  • 湿度
  • 風速
    の4つを取得して表示しているが、もっと他にも取得できた気がする。

CodeIgniterやLaravelあたりを触り始めた時は、フロント(View)の部分とバックエンド(主にController)の部分を分けて書くスタイルになかなかついていけず、初めは嫌いだったけど、今ではこのスタイルが理解しやすく、間にmiddlewareなどのバリデーションチェックやセキュリティ対策等もできたりするので、いいなあと。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?