Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $title = 'title';
- $longtitle = 'longtitle';
- $introtext = 'introtext';
- $content = '';
- $template = '';
- $publishedon = DateTime::createFromFormat('Y-m-d', date('Y-m-d'));
- $published = 0;
- $parent = 31;
- $response = $modx->runProcessor('resource/create', array(
- 'pagetitle' => $title,
- 'longtitle' => $longtitle,
- 'introtext' => $introtext,
- 'content' => nl2br($content),
- 'template' => $template,
- 'publishedon' => $publishedon,
- 'published' => $published,
- 'parent' => $parent));
- if ($response->isError()) {
- $modx->log(xPDO::LOG_LEVEL_ERROR, 'There was a problem to create resource...');
- $modx->log(xPDO::LOG_LEVEL_ERROR, $response->getMessage());
- }
Add Comment
Please, Sign In to add comment