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

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top