Welcome Guest, Not a member yet? Register   Sign In
how do I know which link has been clicked on web page? - CI newbie Q
#4

[eluser]WanWizard[/eluser]
I'm not sure I understand what you mean.

In the standard setup, http://www.example.com/controllername/methodname has a one-to-one connection to a controller, and a method in that controller. Is this not that different from the static html days or the procedural days, where 'controllername' was an individual php file that you would load directly.

You lose the one-to-one if you start routing multiple URI's to a single controller, but you gain simplicity in your application, as you don't have to duplicate code.

CI has a very flat structure, it only supports (without routing) http://www.example.com/controllername/methodname and http://www.example.com/directory/control...methodname (where 'directory' is a folder in your application controllers folder).

The controller is a sort of supervisor. It gets the request (i.e. a task to perform), delegates activities to models to fetch the data needed to complete the task, and passes the data to the view which hands the result (the finished task) back to the requestor. It is the model that has to do whatever needed to retrieve the data requested, either from a database or from another source.


Messages In This Thread
how do I know which link has been clicked on web page? - CI newbie Q - by El Forum - 06-25-2010, 08:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB