$pages->create($uid, $template, $data = array())

Creates a new subpage

  • $uid (string)
    The UID of the new page
  • $template (string)
    The template name for the new page
  • $data (array)
  • return ($page)

Example


try {

  $newPage = page('blog')->children()->create('my-new-article', 'article', array(
    'title' => 'My new article',
    'date'  => '2012-12-12 22:33',
    'text'  => 'This is my new article',
    'tags'  => 'article, text, readable'
  ));

  echo 'The new page has been created';

} catch(Exception $e) {

  echo $e->getMessage();

}

Is something missing or incorrect? Edit this page on Github…