Welcome Guest, Not a member yet? Register   Sign In
How to setup my webpages when dealing with different blocks of info?
#2

[eluser]Aniket[/eluser]
it seems like you have come from a CMS background...np
CI supports SEO friendly urls so u dont have to worry much...
With the topic of displaying blocks ..ideal would be a library..which pulls data from the Database and generates a view.
The controller/method/params is easy to understand..say every important page you want to display to user will have a method in the controller which is the only point of contact for the clients.
Use Models to represent your business entities like "User", "Employee", "Shopping cart" i.e the things you want to store in db..
Following shall be the probable work flow..
Say,
controllers/home.php is the controller.
libraries/renderer.php is your library for displaying your different blocks(library will contain implementation for fetching the data and generating the desired view).
Library makes use of Model if required to process some user specific data.
The view generated by the library is returned to the controller and the controller then appropriately adds the view to the desired main view.
Also its not compulsory that all db related tasks should go in Models...Libraries can also contain db related code.

Hope this helps...pls feel free to ask any doubts for clarification.

Thanks in advance.


Messages In This Thread
How to setup my webpages when dealing with different blocks of info? - by El Forum - 01-08-2010, 03:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB