This repository was archived by the owner on May 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
CodeIgniter Rest API 설정하기
INMD1 edited this page Nov 13, 2024
·
2 revisions
우리가 DB에 접속해서 DB의 내용을 가져오거나 변경할 하기 위해서는 1차 적으로 Model 파일에 정의를 먼저 해줘야 한다
예시로 로그인 페이지를 만드는걸 참조 하겟다.
API 폴더 안에 PHP하나를 생성한다.
<?php namespace App\Models; use CodeIgniter\Model; class UserModel extends Model { protected $table = 'users'; -> DB안에 이런 테이블을 사용하겟다. protected $allowedFields = ['name', 'email', 'password']; }