I created in the codeigniter a helper for the datatable that would return an html with a bootstrap icon.
Follow the function:
function trata_check($valor)
{
$ci= & get_instance();
if($valor=='S'){
$html='<span class="glyphicon glyphicon-ok"></span>';
}
else{
$html='<span class="glyphicon glyphicon-remove"></span>';
}
return $html;
}
The part that calls the function in the controller is this:
->edit_column('diario', trata_check('$1'),'diario')
The problem is that the if($valor=='S')
comparison is not being done, it is always returning false, but when I just return the passed parameter it returns the right value, which can be only S
or N
. / p>