| <?php |
| |
| /** |
| * FoundationDocument() |
| * |
| * @author chrisguindon |
| */ |
| class FoundationDocument { |
| public $title = ""; |
| |
| public $description = ""; |
| |
| public $links = array(); |
| |
| public function setTitle($title) { |
| $this->title = $title; |
| } |
| |
| public function getTitle() { |
| return $this->title; |
| } |
| |
| public function setDescription($description) { |
| $this->description[] = $description; |
| } |
| |
| public function getDescription() { |
| return implode('<br/><br/>', $this->description); |
| } |
| |
| public function setLink($url, $text = 'Read More') { |
| $this->links = array( |
| 'url' => $url, |
| 'text' => $text |
| ); |
| } |
| |
| public function getLink() { |
| if (empty($this->links)) { |
| return ''; |
| } |
| return '<a href="' . $this->links['url'] . '" class="btn-sm btn btn-primary" style="width:100%; font-size:12px;">' . $this->links['text'] . '</a>'; |
| } |
| |
| public function getTableRow() { |
| $html = '<tr><th scope="row">' . $this->getTitle() . '</th><td>' . $this->getDescription() . '</td>'; |
| $html .= '<td class="text-center">' . $this->getLink() . '</td>'; |
| $html .= '</tr>'; |
| return $html; |
| } |
| } |