Jump to content

Create pdf from database info


samoht

Recommended Posts

Hello all,

 

I have a directory page that is populated with a foreach loop pulling info from a db table. I want to make a "Download Directory pdf" button that will print out the directory entries in a nicely formatted way.

The thing is that the foreach loop uses an OO call to what every template is being used for the HTML display:

foreach ( (array) $results as $row)
{
     ...
	$out .= '<div class="cn-list-row' . $alternate . ' vcard ' . $template->slug . ' ' . $entry->getCategoryClass(TRUE) . '">' . "\n";
		$out = apply_filters('cn_entry_before', $out, $entry);
		ob_start();
		include($template->file);
	    $out .= ob_get_contents();
	    ob_end_clean();
		$out = apply_filters('cn_entry_after', $out, $entry);
	$out .= '</div>' . "\n";

}
$out .= '<div class="clear"></div>' . "\n";
$out .= '</div>' . "\n";

$out = apply_filters('cn_list_after', $out, $results);

return $out;
}

 

Any Ideas??

Link to comment
https://forums.phpfreaks.com/topic/228430-create-pdf-from-database-info/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.