Created
February 18, 2014 16:22
-
-
Save boukeversteegh/9074190 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 | |
abstract class DefaultController { | |
public function read($id) { | |
if( empty($id) ) { | |
throw Exception("No ID specified!"); | |
} | |
$this->_read($id); | |
} | |
public abstract function _read($id); | |
} | |
class PostsController extends DefaultController { | |
public function _read($id) { | |
print "You were trying to read post with id {$id}" | |
die(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment