Skip to content

Instantly share code, notes, and snippets.

@leonidlezner
Created April 25, 2016 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leonidlezner/cccccaa1afc20445c613e74318d95508 to your computer and use it in GitHub Desktop.
Save leonidlezner/cccccaa1afc20445c613e74318d95508 to your computer and use it in GitHub Desktop.
Generate multiple pages in ProcessWire
<?php
include('index.php');
$page = $pages->get('/blog');
for($i = 0; $i < 20; $i++) {
$post = new Page();
$post->template = 'blogpost';
$post->parent = $page;
$post->name = 'generated_number_'.$i;
$post->title = 'Generated Number '.$i;
$post->save();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment