Skip to content

Instantly share code, notes, and snippets.

@boukeversteegh
Created February 18, 2014 16:22
Show Gist options
  • Save boukeversteegh/9074190 to your computer and use it in GitHub Desktop.
Save boukeversteegh/9074190 to your computer and use it in GitHub Desktop.
<?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