我有这样的登录表单
登录到应用程序,它显示这样的菜单
它一直很好,直到我点击一些菜单,然后它显示
这是我单击的链接的控制器,我认为keuangan
它已经在菜单上,但是为什么keuangan
当我单击菜单的某些链接时没有出现?
function index()
{
$data['title'] = 'QB Cash Advance Settlement';
$this->load->view('menu',$data);
$this->load->view('v/vcas');
}
这是c_menu
控制器
function index()
{
$data['title'] = "QB Dashboard";
$data['jabatan'] = "Keuangan";
$this->load->view('menu',$data);
$this->load->view('body');
}
这是menu_view
<div id ="user">Selamat datang, <?php echo $jabatan; ?></div>
登录控制器
function login()
{
$username = $this->input->post('username');
$jabatan = $this->input->post('jabatan');
$this->form_validation->set_rules('username','Username','alpha_numeric|trim|required|xss_clean');
$this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean|callback_check_database');
if($this->form_validation->run() == FALSE)
{
$this->load->view('login');
}
else
{
if($jabatan == 'keuangan')
{
redirect('c_menu','refresh');
}
else if ($jabatan == 'hd')
{
echo $jabatan;
}
else
{
echo $jabatan;
}
}
我需要$data['title'] = 'keuangan'
在每个控制器/索引中声明吗?