+ private function produceTXT()
+ {
+ $content = '';
+ foreach ($this->entries as $entry) {
+ $content .= "\n\n" . str_repeat("=",100) . "\n\n" . $entry->getTitle() . "\n\n" . str_repeat("=",100) . "\n\n";
+ $content .= trim(preg_replace('/\s+/S', ' ', strip_tags($entry->getContent()))) . "\n\n";
+ }
+ return Response::create(
+ $content,
+ 200,
+ array(
+ 'Content-type' => 'text/plain',
+ 'Content-Disposition' => 'attachment; filename="'.$this->title.'.txt"',
+ 'Content-Transfer-Encoding' => 'UTF-8',
+ )
+ )->send();
+ }
+
+