Welcome Guest, Not a member yet? Register   Sign In
Variable function names
#2

[eluser]CroNiX[/eluser]
I think it will work if you put the parenthesis after the variable function name, not in the actual variable.
$model = 'Product_model';
$function = 'count_products';

$this->total_rows = $this->CI->$model->$function();

http://php.net/manual/en/functions.varia...ctions.php


Messages In This Thread
Variable function names - by El Forum - 02-22-2011, 02:04 PM
Variable function names - by El Forum - 02-22-2011, 04:11 PM
Variable function names - by El Forum - 02-23-2011, 05:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB