Skip to content

Instantly share code, notes, and snippets.

@alganet
Created August 23, 2012 01:25
Show Gist options
  • Save alganet/3431085 to your computer and use it in GitHub Desktop.
Save alganet/3431085 to your computer and use it in GitHub Desktop.
<?php
//Sample: http://localhost/controller.php?name=Fulano
include 'model.php';
$hw = new HelloWorld;
$name = $_GET['name'];
$greetings = $hw->say($name);
include 'view.php';
<?php
class HelloWorld {
public function say($name) {
return 'Hello '.$name;
}
}
<!doctype html>
<title>Hello World</title>
<p>
<?php echo $greetings;?>, this is your first MVC.
</p>
@jrbasso
Copy link

jrbasso commented Aug 23, 2012

The smaller MVC I have seen. :)

@suissa
Copy link

suissa commented Aug 23, 2012

\o/

@geovanerocha
Copy link

Great MVC example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment