Domanda

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

È stato utile?

Soluzione

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...

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top