안녕하세요. ci3 이용중 궁금증이 있어서 문의 드립니다.
아래와 같이 보통 uri 통한 컨트롤러 function 접근후 db 조회 및 여러가지 기능을 한번에 처리하는
절차지향적 개발방식인거 같은데 ci3 에서도 객체지향 방식으로 개발이 가능한가요??
만약 객체지향방식으로 한다면 라이브러리에 member, order, product 등등 을 만들어서 접근해야 하는것인지 궁금합니다.
감사합니다.
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Offices extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->model('auth'); //load the model
}
public function office($param)
{
$user_info = $this->auth->get_user_id_pwd($cust_seq);
$login_data = array(
'login_kind' => 'A',
'login_passwd' => $user_info->passwd,
'user_id' => $user_info->user_id
);
$result = $this->auth->logins($login_data);
if ($result['StatusCode'] == "200"){
$data['change_pw_date'] = Date('Y-m-d', strtotime("+1 years", strtotime($result['reg_date'])));
}
$this->load->view('offices_view', $data);
}
}한대승(불의회상)
답변감사합니다.
DB 조회는 모델을 사용해서 하고 있습니다. 다른 분들도 다 이렇게 사용하시는지
아니면 OOP 설계를 통한 컨트롤러 구성을 하시는지 궁금해서요.
$this->auth->get_user_id_pwd($cust_seq);