Trying to call the projects controller and the editproject function and pass an id number. Can anyone tell me why the second line doesn’t work? When I echo the value in the first line, it does give me the correct integer as a string
<?php echo $list[0]->id; ?>
<?php echo form_open('projects/editproject/',$list[0]->id ) ;?>
The error I keep getting is “Missing argument 1 for Projects::editproject()” My editproject function is function editproject($id).
I did try:
<?php echo $list[0]->id; ?>
<?php $pdata = (int)$list[0]->id; ?>
<?php echo form_open('projects/editproject/',$pdata ) ;?>
Thinking the call to the controller needed a variable for the data. Same error message as above. THanks for any help.
Did you mean to do this instead ?
The second argument of form_open() accepts an associative array of attributes, hence, you’re mistakenly passing in the id into the second argument when it needs to be concatenated with the url instead.