We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27449
    • 211 Posts
    Hello,
    I am to try create a automatialy document with the DocManager, but when I call the Document class I have an error that "Class Document not found" huh
    This is my code:
    require_once(’../assets/libs/docmanager/document.class.inc.php’);

    $doc = new Document();

    $doc->Set(’editedby’,$userID);
    $doc->Set(’pagetitle’,$title);
    $doc->Set(’tvprojectDescription’,$projectDesc);
    $doc->Set(’tvprojectBudget’,$projectBud);
    $doc->Set(’tvbuildingName’,$buildingName);
    $doc->Save();


    Only a question, I have a modulo that put the information in the database, but I want that this information be it in the new document. I to be able create the new document in the file of the module or I have create a snnipped?
      • 4172
      • 5,888 Posts
      You can try:
      $basePath = $modx->config['base_path'];
      require_once($basePath.'assets/libs/docmanager/document.class.inc.php');
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 10487 MODX Staff
        • 1,535 Posts
        Quote from: sjscosta at Oct 29, 2008, 06:53 AM

        Only a question, I have a modulo that put the information in the database, but I want that this information be it in the new document. I to be able create the new document in the file of the module or I have create a snnipped?
        If you’re creating a module then you can add the code direct into the module, you don’t need to create a snippet. Modules add functionality within the backend manager whereas snippets, in 99% of cases, add functionality to the frontend of the site.
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com