我使用的是CodeIgniter,并且遇到了一个有趣的问题。我需要使用另一个函数的变量。我打算通过简单地声明全局变量(我无法)在框架中做到这一点。所以我试着从另一个内部调用一个函数(这一切都发生在控制器中)。因为显然这不能做我做了一个帮手文件与常见的功能,然后就试图加载它,但我得到这个错误:使用codeigniter调用另一个函数
Fatal error: Call to undefined method ReporteNominas::getValues()
辅助文件是助手文件夹内,它包含此:
function getValues($getThem, $tpar, $vpiso, $tcomi, $tgas, $ttotal){
$totalPares = $tpar;
$ventasPiso = $vpiso;
$totalComisiones = $tcomi;
$totalGastos = $tgas;
$totalTotal = $ttotal;
if($getThem){
return $totalPares . "," . $ventasPiso . "," . $totalComisiones . "," . $totalGastos . "," . $totalTotal;
}
}
,我试图把它这样做:
$this->load->helper('helper_common_functions_helper');
$this->getValues(false, $query['cant'], $query['sum'], $query['com'], $query['gas'], $query['tot']);
什么可能我在这里失去了?