Hey guys!
Ive got a trouble, ive no idea how to create new document.
There is separated php script (in the root), where i use modxapi.php to create modx instance and docapi.class.inc.php but it doesn’t work. (there were errors in docapi.class.inc.php, i fixed them up but it made docapi.class.inc.php go crazy).
Well, im really suprised that i didnt find native tools to do it.
So are there any ways how to create new document in separeted php file?
(or i gotta get into database’s structure and write data right into it?)
All the documents are saved in the database.
There is no need to create a php file.
To create a document just Click on the "New Resource" button.
no, you didnt get me
i clearly understand how to create document into the cms but it aint i need
well i have to sites let it be A and B.
A-site doesnt contain modx and it just collects information in database
B-site is modx site
so i need to trasfer new records from A to B via php script thats why i have php script on B site that gets information via post request in predefined structure then transforms it and saves into the modx database and thats why i gotta know how to create new document in separeted (extern) php file.
so how can i do it?
I think behod wants to create a MODx document in PHP code in a snippet.
If so -- take a look at the code of the NewsPublisher snippet (should be included in your install). It creates new documents from the user’s input.
Thanx fellas!!!
(the 2 last answers are really what i need)