Simple MVP example with PHP
12,965
The difference is twofold:
- view is passive and unaware of model
- presenter (controller) changes state of model, reads information and passes it to view
public function showUsers()
{
// -- snip
$data = $accountManager->getUserDetails($from = 10, $to = 20);
$view->bind('list', $data);
// -- snip
}
This would be a simplified example of presenter's method. Here is an old answer, briefly explaining the differences between MVC-like patterns used in php.
Author by
grape1
Updated on June 04, 2022Comments
-
grape1 almost 2 years
I know how to work with the MVC model, but I don't have an idea how to work with MVP. I read about the differences between them but don't know how to accomplish it.