php - Need of Controllers in codeigniter? -


what controllers in frameworks ? please answer not developer point of view logical point of view. why need ? main core purpose of controllers ?

controllers used split application logic presentation or storage logic.

the models store data , associated manipulation methods. views designed hold data relevant presenting data.

this leaves gap of how link data correct view , how control actions on data. purpose controller added. controller quite aptly controls how data manipulated , presented.

as such controller serves purpose of acting bridge between users request , system user interacting with. instance if user manipulating forms change stored data controller takes responsibility checking data submitted user before manipulating stored data.

in broader sense of word controller there separation of concerns. models need concerned on how store , manipulate data. don't have worry on how user interacts or how presented user. views likewise deal presentation don't concern @ user submitted system or how data came be. view there present delivered data. controller glues these 2 together. result of each section can developed/updated/replaced without breaking entire system.

for more information ask more specific question or read 1 of many books on topic of mvc.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -