0

Can i get a simple php code for knowing the usage of model view controller(MVC) in php.It should also highlight comments also..Any help would be appreciated

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by veedeoo
1

Hi,

I can explain it in simple words without too many comments needed

The Input ---> The Processing of the Input ---> The output or the outcome of the processed input.

In short,

Controller(input) --> model(processing) --> View(output or template)..

Sample script
Controller

## checks if members logged in

$isLogged_in(){
## can instantiate class here

}

## if not logged show the form
## or make sure to offer registration

model

## process the data triggered by the controller
## registration and others
## in other words this will check username against the members in the database
## or will insert new members to the database

View

## show the output
## show content to the logged_in and to not logged_in

## if Smarty templating is included, then this is where the smarty assign takes place.

Edited by veedeoo: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.