Created
May 12, 2018 04:31
-
-
Save pavel-one/9ec3d57cf539e5841afee7aee7724e8f 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