private function prepare_txt($name, $type) { $this->file_contents($name, $type); $title = '<h4>' . str_replace('_', ' ', ucfirst($name)) . '</h4>'; //create content for rendering with txt new lines converted to HTML <br> $content = '<div class="' . $type . '_content">' . nl2br(self::$file_content) . '</div>'; self::$rendered_content = $title . $content; }