Link problem |
[eluser]parham90[/eluser]
[quote author="spider pig" date="1280910540"]If I understand what you want to do, you will need to prefix the links with base_url(). This will then insert the correct web address when executed. So the menu would look like this: Code: <ul> To use base_url(), you will need to make sure the URL Helper is loaded in the controller: Code: $this->load->helper('url'); Or, what I do is load it in the config file autoload.php: Code: $autoload['helper'] = array('url'); Or even better, after autoloading (or loading) the url helper, you can put these in your view file, which is, in my opinion, much more readable: Code: <ul> If you have short tags enabled in your CodeIgniter configuration file, you can even make it as short as: Code: <li><?=anchor('user', 'Index')?></li> and so on. For more information about the URL helper and more examples, take a look at the section about the URL helper in the User Guide. HTH! |
Messages In This Thread |
Link problem - by El Forum - 08-03-2010, 08:26 PM
Link problem - by El Forum - 08-03-2010, 09:29 PM
Link problem - by El Forum - 08-04-2010, 04:57 AM
|