PHP code example of dd / evolutioncms-snippets-ddstash

1. Go to this page and download the library: Download dd/evolutioncms-snippets-ddstash 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-ddstash example snippets


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

[[ddStash?
	&save=`{
		"userData": {
			"firstName": "John",
			"lastName": "Tesla",
			"discipline": "Electrical engineering"
		}
	}`
]]
[[ddStash?
	&save=`{
		"userData": {
			"firstName": "Nikola",
			"lastName": ""
		}
	}`
	&save_extendExisting=`1`
	&save_extendExistingWithEmpty=`0`
]]

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

//Run (MODX)EvolutionCMS.snippets.ddStash
\DDTools\Snippet::runSnippet([
	'name' => 'ddStash',
	'params' => [
		'get' => 'userData.firstName'
	]
]);