Skip to content

Instantly share code, notes, and snippets.

@shaikhul
Last active January 21, 2017 07:26
Show Gist options
  • Save shaikhul/0d6b35ae4f3d6d19e82806106f607648 to your computer and use it in GitHub Desktop.
Save shaikhul/0d6b35ae4f3d6d19e82806106f607648 to your computer and use it in GitHub Desktop.
<?php
/**
* Book Plain Old PHP class
*/
class Book {
private $title;
private $author;
private $current_page;
// lets say it has all getter/setter method
public function getCurrentPage() {
return $this->current_page;
}
// renders current page in plain text
public function renderText() {
return $this->getCurrentPage();
}
// renders current page in HTML format
public function renderHTML() {
return "<p>{$this->getCurrentPage()}</p>";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment