[eluser]Unknown[/eluser]
Hello,
I know that this post might sound stupid and I also know that it is possible to solve this issue using other method that not involves views, but I am still curious.
So, let get to business.
I created a helper function that generates the HTML for showing a message. The function in the helper is:
Code:
function msgbox($msg = NULL, $id_tag = NULL)
{
$CI =& get_instance();
$data['msg'] = ($msg === NULL ? '' : $msg);
if ($id_tag !== NULL)
{
$data['msg_id_tag'] = $id_tag;
}
return $CI->load->view('widgets/msgbox', $data, TRUE);
}
When I want to generate a message box I call in the view <?php echo msgbox('Some message!', '#some_id'); ?>
The problem is when I call the function again, with no $id_tag specified like msgbox('Some other message!'); because the first $id_tag value remains set in the view.
What can I do, to prevent the first $id_tag not to propagate to the second message box too.
Thanks!