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

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.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.