Last active
January 21, 2017 07:26
-
-
Save shaikhul/0d6b35ae4f3d6d19e82806106f607648 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* 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