아래와 같이 해서 저장버튼을 클릭하면 에러가 납니다.
왜 그런지 모르게습니다
=== view ===.
<input type="hidden" name="bo_no" value="" /> <input type="hidden" name="key[]" /> <input type="hidden" name="key[]" />
=== controllers ===
$bo_no = $this->input->post('bo_no', TRUE);
$write_data = array(
'bo_no' => $bo_no,
'be_key' => $this->input->post('key', TRUE)
);
배열 - Array ( [bo_no] => 4 [be_key] => Array ( [0] => [1] => ))
=== 에러 메시지 ==
Severity: Notice
Message: Array to string conversion
Filename: core/Input.php
Line Number: 465
제가 CI를 2.1까지하고 3.0은 아직 안해봐서 잘 모르겠는데요
$this->input->post('key', TRUE) 자체가
$_POST['key']; 랑 동일하게 작동되는거 아닌가요?
html에서는 배열로 받으셨는데 입력값을 string으로 넣을려고하니 에러나오는 것 같습니다.
var_dump로 분석해보세요
게시판 이동합니다.
배열로 넘겼으면 배열로 받으셔야.. (말이 좀 이상하지만)
$bo_no = $this->input->post('bo_no[]', true);