Created
August 23, 2012 01:25
-
-
Save alganet/3431085 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Sample: http://localhost/controller.php?name=Fulano | |
include 'model.php'; | |
$hw = new HelloWorld; | |
$name = $_GET['name']; | |
$greetings = $hw->say($name); | |
include 'view.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class HelloWorld { | |
public function say($name) { | |
return 'Hello '.$name; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>Hello World</title> | |
<p> | |
<?php echo $greetings;?>, this is your first MVC. | |
</p> |
\o/
Great MVC example.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The smaller MVC I have seen. :)