PHP code example of dd / evolutioncms-snippets-ddrunsnippets
1. Go to this page and download the library: Download dd/evolutioncms-snippets-ddrunsnippets 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-ddrunsnippets example snippets
//Include (MODX)EvolutionCMS.libraries.ddInstaller
nstaller/Installer::install([
'url' => 'https://github.com/DivanDesign/EvolutionCMS.snippets.ddRunSnippets',
'type' => 'snippet',
]);
//Install (MODX)EvolutionCMS.plugins.ddRunSnippets (it is
//Just for example let the snippet do nothing but only return an array :)
return [
'name' => 'Tamara Eidelman',
'birthdate' => '1959.12.15',
'links' => [
'youtube' => 'https://youtube.com/c/TamaraEidelmanHistory',
'site' => 'https://eidelman.ru',
],
];
//Include (MODX)EvolutionCMS.libraries.ddTools
/ddTools/modx.ddtools.class.php'
);
//Run (MODX)EvolutionCMS.snippets.ddRunSnippets
\DDTools\Snippet::runSnippet([
'name' => 'ddRunSnippets',
'params' => [
'snippets' => [
'someSnippet' => [
'exampleParam' => 'Example value.',
],
'otherSnippet' => [
'someParam' => '[+someSnippet+]',
],
'anotherSnippet' => [
'[+otherSnippet+]' => '[+someSnippet+]',
],
],
'outputterParams' => [
'tpl' => '@CODE:[+anotherSnippet+]',
],
],
]);