开发者

how to create new document from snippet in modx evolution 1.0.4

开发者 https://www.devze.com 2023-01-26 07:55 出处:网络
i found example for older version, but my current version has not assets/libs/docmanager/document.class.inc.php file and libs folder dosn\'t exists too. HELP GUYS!

i found example for older version, but my current version has not assets/libs/docmanager/document.class.inc.php file and libs folder dosn't exists too. HELP GUYS!

function CreateNewArticle(&$fields){
// Массив $fields будет содержать данные всех полей формы
// Создания документа с описанием.
require_once('assets/libs/docmanager/document.class.inc.php');
$doc = new Document(); // создаем документ
$doc->Set('parent',9); // определяем в какую папку положить
$doc开发者_开发知识库->Set('template','psih'); // задаем шаблон
$doc->Set('content',$fields['content']); // основное содержимое
// Далее пойдут TV-параметры
$doc->Set('tvAvtor',$fields['avtor']); // автор
$doc->Set('tvEmail',$fields['email']); // e-mail
$doc->Save(); // сохраняем
return true; // Говорим eForm, что все в порядке.

}


download docmanager: http://modxcms.com/extras/package/108?version=165


Install CakeMOdx. It's an API class for MODx Evolution. It provides, among other things, a function "newDocument".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号