CI Ignited-Datatables, wrong variable returning |
I think you have misinterpreted what they have done...
What you are doing is passing in a string instead of a variable as your parameter to the function renderStato(). As you have seen, it is passing in the literal string $1 as you have surrounded it in single quotes. Stock standard PHP Programming rules apply, if you wrap anything in single quotes - it's the literal string. If you wrap a variable in double quotes - then it gets evaluated ( Big difference ) But in your case you do not need either. So your call... PHP Code: edit_column('stato', renderStato('$1'), 'stato'); PHP Code: edit_column('stato', renderStato($1), 'stato'); AND please do not use variable names like $1, that is a Huge NO NO! Rule of thumb: "Name a Variable What it is", even if it's a little long winded. |
Messages In This Thread |
CI Ignited-Datatables, wrong variable returning - by mr.web - 12-26-2015, 03:37 AM
RE: CI Ignited-Datatables, wrong variable returning - by Tim Brownlaw - 12-26-2015, 08:53 PM
RE: CI Ignited-Datatables, wrong variable returning - by RWCH - 03-10-2016, 06:53 AM
|