We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8522
    • 145 Posts

    on: http://svn.modxcms.com/docs/display/xPDO20/Setting+Object+Fields


    In example:
    // Let us say that:
    // $_POST = array(
    // ’test_w’ => 12,
    // ’test_h’ => 13,
    // );
    $myBox->fromArray($_POST,’_test’);

    the prefix sould be:
    $myBox->fromArray($_POST,’test_’);


    in example:
    $box23 = $xpdo->newObject(’Box’);
    $box23->fromArray(array(
    ’id’ => 23,
    ’width’ => 5,
    ’height’ => 5,
    ));
    echo $box->get(’id’); // prints ’23’

    Last line should be:
    echo $box23->get(’id’); // prints ’23’

    Could $box23 be changed to $myBox, so it would be consistent on the whole page?

      • 28215
      • 4,149 Posts
      Done. Thanks!
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com