2017-11-20 1 views
0

는 일부 라이브러리는Codeigniter를 사용하여 데이터베이스에 사이트 구성/옵션을 저장하는 가장 좋은 방법은 무엇입니까?

워드 프레스 https://developer.wordpress.org/reference/functions/get_option/ 과 드루팔 https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/variable_get/7.x처럼, 데이터베이스의 필드 데이터 저장 사이트 구성에 사용할 수 있는가 또는 상점 사이트 변수에 어떤 좋은 방법이 있나요? 또한 관리자가 수정할 수 있도록 허용합니다. 내가 CMS에서 일하는 단지 관련 질문 목록에서 CodeIgniter의

+0

더 나은 방법을 체크 아웃되었습니다 [이 꽤 좋은 답변처럼 보인다. (https://stackoverflow.com/a/4870189/3585500) – ourmandave

답변

1
Go to application > config > database file and edit database config. 
    $active_group = 'default'; 
    $query_builder = TRUE; 

    $db['default'] = array(
    'dsn' => '', 
    'hostname' => 'localhost', 
    'username' => 'root', 
    'password' => '', 
    'database' => 'exampl_database', 
    'dbdriver' => 'mysqli', 
    'dbprefix' => '', 
    'pconnect' => FALSE, 
    'db_debug' => (ENVIRONMENT !== 'production'), 
    'cache_on' => FALSE, 
    'cachedir' => '', 
    'char_set' => 'utf8', 
    'dbcollat' => 'utf8_general_ci', 
    'swap_pre' => '', 
    'encrypt' => FALSE, 
    'compress' => FALSE, 
    'stricton' => FALSE, 
    'failover' => array(), 
    'save_queries' => TRUE 
);