help!!! base_url unable to rediret to another page - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: help!!! base_url unable to rediret to another page (/showthread.php?tid=54865) |
help!!! base_url unable to rediret to another page - El Forum - 09-28-2012 [eluser]Unknown[/eluser] Hi there, I'm new using CI to do web programming. I have a hard time to redirect my home page to another page. I have read some discussion of using base_url but still I can not find a way. here is the code I have configure the base url in config.php $config['base_url']= 'http://localhost/arvindo/'; autoload the helper $autoload['helper'] = array('html','url'); here is the controller of home class Home extends CI_Controller { function index() { $this->load->view('temp_header'); $this->load->view('home'); $this->load->view('temp_nav'); } } I try to test the menu list: Code: <li><a href="<?php echo base_url();?>home"> Home</a></li> but the output is Object not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error. If you think this is a server error, please contact the webmaster. Error 404 localhost Apache/2.4.2 (Win32) OpenSSL/1.0.1c PHP/5.4.4 Can somebody help me please? sorry if my writing skill is not good help!!! base_url unable to rediret to another page - El Forum - 09-29-2012 [eluser]Ed Robindon[/eluser] Hi, The controller functions are not available to the view. You can, however, pass the baseurl to the view in an array of data. Here's a simple test controller: Code: <?php And the view: Code: <!DOCTYPE html> Code: <IfModule mod_rewrite.c> Hope this gets you going... Ed help!!! base_url unable to rediret to another page - El Forum - 09-29-2012 [eluser]Unknown[/eluser] Thanks, it's working |