Created
April 25, 2016 15:56
-
-
Save leonidlezner/cccccaa1afc20445c613e74318d95508 to your computer and use it in GitHub Desktop.
Generate multiple pages in ProcessWire
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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