Skip to content

Instantly share code, notes, and snippets.

@adamlundrigan
Created November 29, 2011 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamlundrigan/1404660 to your computer and use it in GitHub Desktop.
Save adamlundrigan/1404660 to your computer and use it in GitHub Desktop.
Extending MODx
<?php
require_once '/path/to/modx/config.core.php';
require_once MODX_CORE_PATH.'model/modx/modx.class.php';
$modx = new modx();
$modx->initialize('web');
// Load document by ID, set longtitle, save it
$doc = $modx->getObject('modDocument', array('id'=>1));
$doc->set('longtitle', 'foo');
$doc->save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment