How do you add a link for the homepage? |
[eluser]johnnyForums[/eluser]
I have this: Code: <div id="menu"> The href="" is replaced by whatever was my last view call. What I want is for homepage to go back to the main website page. How do I do that? I don't know what to put there other than index to call the /mycontroller/index function. I didn't know if that was "the way" it was done.
[eluser]garymardell[/eluser]
Code: <li class="current_page_item"><a href="<?=base_url();?>">Homepage</a></li> or Code: <li class="current_page_item"><?=anchor("", "Homepage");?></li>
[eluser]johnnyForums[/eluser]
[quote author="garymardell" date="1248465670"] Code: <li class="current_page_item"><a href="<?=base_url();?>">Homepage</a></li> or Code: <li class="current_page_item"><?=anchor("", "Homepage");?></li> The first one put me too far back. It did not put be at the default controller so I must not have something set right. It is http://127.0.0.1/myvirtualdirectory instead of http://127.0.0.1/myvirtualdirectory/mydefaultcontroller. The second one put me at http://127.0.0.1/myvirtualdirectory/index.php but did not put me at the default controller. I got 404 on both. I put in a simple "index" but I would like to make your way work.
[eluser]garymardell[/eluser]
Well you obviously have not setup codeigniter quite right. In the routes.php file have you set the right default controller. and also is your base_url in configs file right. |
Welcome Guest, Not a member yet? Register Sign In |