Я хочу запустить свою вторую функцию (функцию вставки) при загрузке (client/results)
.запустить запрос на приватную функцию event codeigniter
поэтому, когда getResults в триггере я хочу также запустить функцию создания.
private function getResults()
{
$data['emailcount'] = $score = $this->actions->getEmailCount();
$data['sentEmailCount'] = $score = $this->actions->getSentEmailCount();
$data['score'] = $score = $this->actions->getScore();
$data['percentile'] = $percentile = $this->actions->getPercentile($score);
$data['timespent'] = $this->input->get('time');
// echo $this->input->get('time');
return $this->load->view('client/results', $data);
}
function create()
{
$adddata = array(
'uniID' => '5',
'testName' => 'Abintegro E-Tray test',
'testID' => '99999',
'total' => '20',
'userID' => '00000',
'useInPercentile' => '1',
'correct' => $score = $this->actions->getScore(),
'percent' => $score = $this->actions->getScore(),
'percentile' => $percentile = $this->actions->getPercentile($score),
'dateTaken' => date('Y-m-d H:i:s'),
// 'timeSpent' => $this->input->get('time')
);
$this->actions->add_record($adddata);
$this->index();
}
, что я пытался
private function getResults()
{
$data['emailcount'] = $score = $this->actions->getEmailCount();
$data['sentEmailCount'] = $score = $this->actions->getSentEmailCount();
$data['score'] = $score = $this->actions->getScore();
$data['percentile'] = $percentile = $this->actions->getPercentile($score);
$data['timespent'] = $this->input->get('time');
// echo $this->input->get('time');
$this->create();
return $this->load->view('client/results', $data);
}
, но это создает ошибку
Fatal error: Maximum function nesting level of '256' reached, aborting! in C:\wamp64\www\New\system\database\DB_query_builder.php on line 2507
и попытался
private function getResults()
{
{
$data['emailcount'] = $score = $this->actions->getEmailCount();
$data['sentEmailCount'] = $score = $this->actions->getSentEmailCount();
$data['score'] = $score = $this->actions->getScore();
$data['percentile'] = $percentile = $this->actions->getPercentile($score);
$data['timespent'] = $this->input->get('time');
// echo $this->input->get('time');
$this->create();
return $this->load->view('client/results', $data);
};
$this->actions->add_record($adddata);
$this->index();
}
Спасибо, Ive исправил его –