Guest User

Untitled

a guest
May 26th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?
  2. $title = 'title';
  3. $longtitle = 'longtitle';
  4. $introtext = 'introtext';
  5. $content = '';
  6. $template = '';
  7. $publishedon = DateTime::createFromFormat('Y-m-d', date('Y-m-d'));
  8. $published = 0;
  9. $parent = 31;
  10.  
  11. $response = $modx->runProcessor('resource/create', array(
  12. 'pagetitle' => $title,
  13. 'longtitle' => $longtitle,
  14. 'introtext' => $introtext,
  15. 'content' => nl2br($content),
  16. 'template' => $template,
  17. 'publishedon' => $publishedon,
  18. 'published' => $published,
  19. 'parent' => $parent));
  20. if ($response->isError()) {
  21. $modx->log(xPDO::LOG_LEVEL_ERROR, 'There was a problem to create resource...');
  22. $modx->log(xPDO::LOG_LEVEL_ERROR, $response->getMessage());
  23. }
Add Comment
Please, Sign In to add comment