![]() |
Dashboard navigation problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1) +--- Forum: Lounge (https://forum.codeigniter.com/forumdisplay.php?fid=3) +--- Thread: Dashboard navigation problem (/showthread.php?tid=71744) |
Dashboard navigation problem - kvanaraj - 09-18-2018 i am having two dashboard one for user and another of Admin In the header when i click the admin page it cannot navigate to the corresponding page. <a href="<?php echo base_url(); ?>users/dashboard"><?php echo $this->session->userdata('username'); ?></a> User dashboard Code: $data['title'] = 'Dashboard'; Admin Dashboard Code: $data['title'] = 'Admin Dashboard'; how to redirect ? RE: Dashboard navigation problem - Pertti - 09-18-2018 You can either have two different controllers, and do Code: <a href="<?php echo site_url($isAdmin === true? 'admin/dashboard' : 'users/dashboard') ?>">... Or you could have single controller, link to users/dashboard, but then do PHP Code: $this->load->model('user_model'); RE: Dashboard navigation problem - Wouter60 - 09-18-2018 I've shown you several times that CI has a helper function called anchor(). Instead of: PHP Code: <a href="<?php echo base_url(); ?>users/dashboard"><?php echo $this->session->userdata('username'); ?></a> Do this: PHP Code: <?= anchor('users/dashboard', $this->session->username);?> RE: Dashboard navigation problem - kvanaraj - 09-19-2018 (09-18-2018, 10:02 AM)Wouter60 Wrote: I've shown you several times that CI has a helper function called anchor(). after upload my files into server this anchor tag not working. what to do? RE: Dashboard navigation problem - Wouter60 - 09-19-2018 What is your $config['base_url'] setting in application/config/config.php? RE: Dashboard navigation problem - kvanaraj - 09-19-2018 (09-19-2018, 07:37 AM)Wouter60 Wrote: What is your $config['base_url'] setting in application/config/config.php? Code: $base = "http://".$_SERVER['HTTP_HOST']; or $config['base_url'] = 'http://127.0.0.1/project1/'; RE: Dashboard navigation problem - InsiteFX - 09-20-2018 And why are you posting this in the Forum Lounge? This should be posted in the General Help section of the Forum. |