Newbie - Setup and URL Questions |
[eluser]joshdrew[/eluser]
I set up Codeigniter..left everything pretty much default. I was able to create a few pages and registration forms and so far so goo. My question is regarding urls and templates. I have a mysite.php controller file. this performs the necessary functions to pass variables into my view pages to get the right content for my template. ex: Code: function about() { I have a template file in views that pulls everything together Code: $this->load->view('includes/header'); I then added a default controller called "mysite" to the routes config. if I go to http://mysite.com I get the index page. Great. if I go to http://mysite.com/mysite/about I get the about page. Ok. Questions 1. How can i get the about page by just going to http://mysite.com/about. I can do that WITHOUT templates but not with one. I must have something set up incorrectly. 2. If I wanted a "members" area like http://mysite.com/members/index how do I set that up? do I create a subdirectory in the controllers dir called members? Thanks.
[eluser]rogierb[/eluser]
1: Routes 2: Routes or a controller called members. Read up on Routes in the userguide, wiki and this forum
[eluser]joshdrew[/eluser]
I read up on routes a bit and figured out how to eliminate the "controller" from the url. so what I stated before about mysite.com/mysite/about is now mysite.com/about. The other question is still open a bit. I found this post http://ellislab.com/forums/viewthread/119780/ ...looks like what I am trying to accomplish but no dice. i currently have Code: +controllers where mysite.php is the default controller. I would like member.php to be the members controller. so if I go to mysite.com/members/index or mysite.com/members/welcome the member.php would take care of the pages. right now i keep getting 404. I added members to the routes.config but no dice either. Am I on the right path?
[eluser]joshdrew[/eluser]
Ahhhh...the default_controller is the default for the whole site, including subdirectories. i had member/member.php and it was never finding it once i changed it to member/mysite.php which is the default all is well. am i approaching this correctly? |
Welcome Guest, Not a member yet? Register Sign In |