PHP code example of dd / evolutioncms-snippets-ddobjecttools

1. Go to this page and download the library: Download dd/evolutioncms-snippets-ddobjecttools library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dd / evolutioncms-snippets-ddobjecttools example snippets


//Include (MODX)EvolutionCMS.libraries.ddInstaller
nstaller/Installer::install([
	'url' => 'https://github.com/DivanDesign/EvolutionCMS.snippets.ddObjectTools',
	'type' => 'snippet',
]);

//Include (MODX)EvolutionCMS.libraries.ddTools
/ddTools/modx.ddtools.class.php'
);

//Run (MODX)EvolutionCMS.snippets.ddObjectTools
\DDTools\Snippet::runSnippet([
	'name' => 'ddObjectTools',
	'params' => [
		'sourceObject' => [
			'cat' => 'mew',
			'dog' => [
				'name' => 'Floyd',
				'weight' => 6,
			],
			'rabbit' => 42,
		],
		'extend' => [
			'objects' => [
				[
					'dog' => [
						'weight' => 11,
					],
					'bird' => 0,
				],
			],
		],
	],
]);