i am getting error illegal sting offset in variable 'slug' and 'judul' in my view. can you tell me what the probelm.
controller
function index()
{
$slug = $this->uri->segment(2);
$this->data['halaman'] = $this->mhalaman->get_profil($slug);
if (empty($this->data['halaman'])) {
show_404();
}
$this->data['judul'] = $this->data['halaman']['judul'];
//var_dump($halaman_item['slug']);
$this->data['orang'] = $this->mlogin->dataPengguna($this->session->userdata('username'));
$this->data['contents'] = $this->load->view('page', $this->data, true);
$this->load->view('template/wrapper/mahasiswa/wrapper_content',$this->data);
}
view
<div class="section ui dropdown link item">
<span class="count">Profil</span>
<div class="menu">
<?php foreach ($halaman as $dt) : ?>
<div class="item">
<a href="/tkd/index.php/page/<?php echo $dt['slug'] ?>"><?php echo $dt['judul'] ?></a> //line error
</div>
<?php endforeach; ?>
</div>
</div>
modal
function get_profil($slug = FALSE)
{
if ($slug === FALSE)
{
$query = $this->db->get($this->tbl_halaman);
return $query->result_array();
}
$query = $this->db->get_where($this->tbl_halaman, array('slug'=>$slug));
return $query->row_array();
}
please help me what to do. thank you