내 컨트롤러이 같다 :CodeIgniter의 뷰에서 컨트롤러의 함수를 호출하는 방법은 무엇입니까?
public function index()
{
$data_login = $this->session->userdata('login');
$id = $data_login['customer_id'];
$this->data['notification'] = $this->get_data($id);
$this->load->view('notification/list_view', $this->data);
}
public function time_elapsed_string($datetime, $full = false)
{
...
}
내보기 (list_view하면)이 같다 :
: 실행되면Fatal error: Call to undefined method EX_Loader::time_elapsed_string().....
<table class="table table-striped table-advance table-hover">
<tbody>
<?php
foreach ($notification as $key => $value)
{
?>
<tr class="unread" data-messageid="1">
<td class="view-message ">
<?php
echo '<a href='.base_url().'notification/notif/'.$value['notification_id'].'>'.$value['notification_message'].'</a><br>';
?>
</td>
<td class="view-message text-right"> <?php echo $this->time_elapsed_string($value['notification_created_date']); ?> </td>
</tr>
<?php
}
?>
</tbody>
</table>
은 이와 같이 에러가 존재
컨트롤러에 time_elapsed_string
함수를 호출 할 수 있습니다.
내 문제를 해결하려면 어떤 해결책이 있습니까?