Skip to content

Instantly share code, notes, and snippets.

@oksushi
Created October 14, 2011 02:40
Show Gist options
  • Save oksushi/1286118 to your computer and use it in GitHub Desktop.
Save oksushi/1286118 to your computer and use it in GitHub Desktop.
MODX: Plugin to create sub document on save - apply OnDocFormSave
<?php
if ($mode == 'new') {
$new = $modx->newObject('modDocument');
$new->set('parent',$id);
$new->set('pagetitle','My New Pagetitle');
$new->save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment