2012-11-26 2 views
1

이 메서드에서 사용할 수있는 $options 매개 변수는 무엇입니까?MODX Revo getChildIds 옵션

array getChildIds ([integer $id = null], [integer $depth = 10], [array $options = array()]) 

나는 아이들의 별명이 "f"가 아닌 모든 아이들 (깊이 = 3)을 얻는 방법을 찾고있다.

답변

3

사용이 :

<?php 
$id = 123; 
$depth = 3; 

$ids = $modx->getChildIds($id, $depth); 
$docs = $modx->getCollection('modResource', array(
    'id:IN' => $ids 
    ,'alias:!=' => 'f' 
)); 
$output = ''; 
foreach ($docs as $doc) { 
    $output .= $doc->get('pagetitle') . '<br/>'; 
} 

return $output; 
+0

멋진 대답! 하지만 질문이 있습니다 : getCollection을 사용할 때 : 콘텐츠 필드가있는 완전한 개체가 아닌 결과입니까? – BennyLava

+0

이 기사를 읽는 것이 좋습니다 - http://bobsguides.com/revolution-objects.html – Vasis

+0

매주 두 번 그 기사를 읽었습니다. – BennyLava