Question

I would like to create an automated system that creates new Document (Resources Pages) using PHP instead of the UI. However I cant find any tutorial on how to do that from PHP.

Does anyone know how could I do that or if I can do that?

I am using Modx Revolution

Était-ce utile?

La solution

This should do it:

$resource = $modx->newObject('modResource');
$resource->fromArray(array(
    'pagetitle' => 'My Resource Title',
    // add other resource properties here
));
$resource->save();

There are some forum posts and articles out there that will help you with this, if you Google hard enough...

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top