-
- 9 Posts
Не могу разобрать, почему сниппет выводит цифры, названия альбомов/папок латиницей и цифры вместо фото в слайдере, типа {Name название 4521/458/25584/.... может я сниппет перепутал, может код вывода неправильный. В чем может быть проблема, помогите, посоветуйте.
Код сниппета:
<?php
$criteria = $modx->newQuery("modResource");
$criteria->where(array(
'parent' => 2,
'published' => 1
));
$criteria->sortBy("menuindex", "ASC");
if(!$docs = $modx->getCollection('modResource', $criteria)){return;}
$i = 1;
foreach($docs as $doc){
$name = $doc->get('pagetitle');
$content = $doc->get('content');
$gal = $doc->getTVValue('galName');
$content = nl2br($content);
$doors[] = Array('name' => $name, 'text' => $content, 'gal' => $gal);
}
return json_encode($doors);