Guest User

Untitled

a guest
Mar 20th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2. $where = $modx->newQuery('modResource');
  3. $where->leftJoin('modTemplateVarResource', 'TemplateVarResources');
  4. $where->leftJoin('modTemplateVar', 'tv', "tv.id=TemplateVarResources.tmplvarid");
  5. $where->limit(5); // Лимит
  6. $where->where(array(
  7. array(
  8. 'tv.name' => 'tags', // Имя TV
  9. 'TemplateVarResources.value' => 'modx', // Значение TV
  10. 'parent' => '1', // Родитель
  11. ),
  12. ));
  13. $resources = $modx->getCollection('modResource', $where);
  14. foreach ($resources as $key => $value) {
  15.  
  16. }
Add Comment
Please, Sign In to add comment