Welcome Guest, Not a member yet? Register   Sign In
Need help with "segmenting" URI
#1

[eluser]ammtar[/eluser]
I know the Title sounds weird, but I don't know how to explain my issue within few words :-)

Anyway... I'm new with CI, please be gentle :-)

The company I work for (e.g. service.com) offers a service to our clients (client1, client2, client3,... , clinetN). The service is on our server and the have to go to http://service.com/client1, http:/service.com/client2 etc.

I made a controller homepage.php

Code:
class Homepage extends Controller {
  function index()
  {
    $this->load->view('homepage_view);
  }
}

in config/routes.php I have
Code:
$route['default_controller'] = "homepage";

If client goes to "his" page (http://service.com/client1) and to be able to see view file client_view.php (for all clients) I had to create
Code:
function client1 {
  $this->load->view('client_view);
}

within the homepahe.php controller.
The same for clinet2, client2,... Means, for EACH client same function but different name. And it could be hundreds of functions. And each time we got a new client I have to modify the homepahe.php controller. I know that's wrong and there is 110% better way - but I can't figure it out by myself.

Please, any suggestions?

p.s. I'm playing now with CI 1.7.3 because most of tutorials are for 1.7.x. Though, I plan to switch (once I'm comfortable) to CI 2.


Messages In This Thread
Need help with "segmenting" URI - by El Forum - 08-14-2011, 09:38 AM
Need help with "segmenting" URI - by El Forum - 08-14-2011, 09:43 AM
Need help with "segmenting" URI - by El Forum - 08-14-2011, 10:53 AM
Need help with "segmenting" URI - by El Forum - 08-14-2011, 11:57 AM
Need help with "segmenting" URI - by El Forum - 08-14-2011, 06:32 PM
Need help with "segmenting" URI - by El Forum - 08-15-2011, 07:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB