Created
June 17, 2014 13:15
-
-
Save Codenator81/769c536b2379e8383be0 to your computer and use it in GitHub Desktop.
Код процессора для сниппета
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// пространство имён которое мы создали для процессора | |
$namespace = 'site_processor'; | |
// проверка на то что процессор есть | |
if(!$response = $modx->runProcessor('web/resources/getdata', | |
array( | |
// Параметры | |
), array( | |
// задаём путь к процессору | |
'processors_path' => $modx->getObject('modNamespace', $namespace)->getCorePath().'site/', | |
))){ | |
print "Не удалось выполнить процессор"; | |
return; | |
} | |
// записываем результат в переменку | |
$output = $response->getResponse(); | |
// добавляем к шаблону переменку | |
$modx->twig->addGlobal('blogData',$output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment