How to hardcode add and move pages in php

Permalink
Hi.

I need to add a page and then move it under the correct parent in php. I was wondering if I could get some examples on how to do this.

So far, I've found the functions:
Concrete5_Model_Page->add(collectiontype $ct, array $data);
Concrete5_Model_Page->move($nc, $retainOldPagePath = false);

However, there werent any examples on how to use these. One of the questions was, what do I put in $nc?


Thanks.

 
TechnatomyClient replied on at Permalink Reply
I found a link with some help regarding hardcoding an add block function.

http://www.concrete5.org/community/forums/customizing_c5/adding-a-b...

$parentPage = Page::getByID(98, 'RECENT');
$data = array(
'name' => $_POST['name'],
'cHandle' => $_POST['name'] . "_handle",
'cDescription' => $_POST['description']
);
$pt = CollectionType::getByHandle('full');
$newPage = $parentPage->add($pt,$data);


I still would like to know what the $nc stands for since I might be using it later.