PHP code example of mmx / fenom
1. Go to this page and download the library: Download mmx/fenom 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/ */
mmx / fenom example snippets
$tpl = $modx->getOption('tpl', $scriptProperties);
$var = $modx->getOption('var', $scriptProperties);
if ($service = $modx->services->get('mmxFenom')) {
$service->addModifier('hello', static function($var) {
return $var . ' World!';
});
return $service->fetch($tpl, ['var' => $var]);
}
return '';