Jump to content

Export Pages as xls or csv


iNoize
 Share

Recommended Posts

The CSV format is so simple you can easily create a template to generate the right output. As an example:

<?php
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="export.csv"');

$items = $pages->find("template=basic_page");
echo "title,url" . PHP_EOL;
foreach($items as $item) {
    echo "\"$item->title\",\"$item->url\"" . PHP_EOL;
}

 

  • Like 10
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...