PHP code example of dd / evolutioncms-snippets-ddgetmultiplefield

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


// Include (MODX)EvolutionCMS.libraries.ddInstaller
staller/ld
\DDInstaller::install([
	'url' => 'https://github.com/DivanDesign/EvolutionCMS.snippets.ddGetMultipleField',
	'type' => 'snippet'
]);

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

// Run (MODX)EvolutionCMS.snippets.ddGetMultipleField
\DDTools\Snippet::runSnippet([
	'name' => 'ddGetMultipleField',
	'params' => [
		'inputString' => '[
			[
				"assets/images/example1.png",
				"Example image 1"
			],
			[
				"assets/images/example2.png",
				"Example image 2"
			]
		]',
		'rowTpl' => '@CODE:<img src="[+col0+]" alt="[+col1+]" />',
	],
]);

[[ddGetMultipleField?
	&inputString=`[*images*]`
	&rowTpl=`images_item`
]]
html
<a href="[~16~]?tags=[+col0+]">[+col0+]</a>
html
<p>[+rowNumber+]. [+col0+], [+col1+], [+col2+] — <i>[+price+]</i>.</p>