<?php $content_model = cmsCore::getModel('content'); $cats_ids = $content_model->getContentItemCategories($ctype['name'], $item['id']); } // if(is_array($cats_ids)) { // $cats_ids = array_diff( $cats_ids, array($item['category_id']) ); // } if ($cats_ids) { $table_name = $content_model->table_prefix . $ctype['name'] . "_cats"; $cats = $content_model-> filterIn('id', $cats_ids)-> get($table_name, function($item, $model){ return $item['title']; }); $slugs = $content_model-> filterIn('id', $cats_ids)-> get($table_name, function($item, $model){ return $item['slug']; }); for ($i=0; $i<$kol; ++$i) { ?> <a href="<?php echo $ctype['name'];?>/<?php echo $slugs[$kcats[$i]];?>"><?php echo $cats[$kcats[$i]];?></a> <?php $r=$i+1; if ($r<$kol) {?>, <?php } } } } ?>
Решение