Welcome Guest, Not a member yet? Register   Sign In
set_value() for getting array in return
#1

[eluser]Unknown[/eluser]
Hello Everybody,

I have download the new version of codeigniter and it give me following error when I use set_value() for getting array in return.

ERROR
------
Warning (in_array() expects parameter 2 to be array, string given in file: views/add_role_view.php on line: 123)

Actually my task is to set the checked values of checkboxes after postback.

Have a look my code.
Code:
<?php
$page_id = array();
$page_id = set_value('assignRole[]');

foreach($data as $row){
?>
<input type="checkbox"  value="<?php echo($row->page_id); ?>" name="assignRole[]" <?php if(!empty($page_id) && in_array($row->page_id, $page_id)){?>checked="checked" <?php }?> />
<?php
}
?>

$row->page_id is a unique ID coming from loop send by controller in $data variable.

It was working fine in previous version i.e. 1.7.3 but when I installed the new version it going to mass.

By the way I am using version 2.1.2

Any idea??


Messages In This Thread
set_value() for getting array in return - by El Forum - 07-17-2012, 03:04 AM
set_value() for getting array in return - by El Forum - 07-17-2012, 09:17 PM
set_value() for getting array in return - by El Forum - 07-18-2012, 01:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB