[eluser]OneCorea[/eluser]
Suppose this!...
board controller(board/bRead) loads a read view transferring with data[] fields..
and in the read view..there's a form section in the middle of read view file,
When the form submitted, it's called the controller&method;(board/commentPost) and reloading the same view file('read' view file)
Well, here's my problem!!!..
when the 'read' view file reloaded after the form submitted..
the data[] fields is disappeared because I didn't load the data[] field inside commentPost function...
You may ask "Why don't you define every data[] fields in the function..??",
but there's lots of data[] field to define..
So,
Is there any method for 'commentPost() function' to receive every data[] field in the read view file loaded by the controller(board/bRead)?
<controllers/board.php>
Code:
class Board extends Controller{
...
...
function bRead(){
....
$data['aaa'] = 'this is aaaa data in read view';
$data['bbb'] = 'bbb';
==> There's lots of $data[] fields..
$this->load->view('read', $data);
}
function commentPost(){
...
if($this->validation->run()){
//==> inserting database..
$this->load->view('read');
}
else{
error msg;;;
$this->load->view('read');
}
}
}
View/read.php
Code:
<html><body>
<?=$aaa?>
..blah blah
<?=$bbb?>
...blah blah
there are lots of data field from controller
...
<?=form_open('board/commentPost/$code/$no')?>
<input type=text name='writer>
<textarea name=comment></textarea>
<input type=submit value='Submit'>
</form
</body></html>