Welcome Guest, Not a member yet? Register   Sign In
CI Ignited-Datatables, wrong variable returning
#2

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'); 
Should be

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.
Reply


Messages In This Thread
RE: CI Ignited-Datatables, wrong variable returning - by Tim Brownlaw - 12-26-2015, 08:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB