-
-
Save zexeder/dabd05f469591f883f2ba56948281405 to your computer and use it in GitHub Desktop.
Кастомные данные для тв
This file contains hidden or 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 | |
//@EVAL return $modx->runSnippet('getDepartament'); | |
$pdo = $modx->getService('pdoFetch'); | |
$pdo->setConfig(array( | |
'parents' => 137, | |
'limit' => 0, | |
'sortby' => 'id', | |
'select' => 'id,pagetitle', | |
'return' => 'data', | |
'where' => [ | |
'isfolder' => 1, | |
] | |
)); | |
$arr = $pdo->run(); | |
$outArr = array(); | |
foreach ($arr as $item) { | |
$outArr[] = $item['pagetitle'].'=='.$item['id']; | |
} | |
$out = implode('||', $outArr); | |
return $out; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment