0
我正在使用getResource,我想檢索資源的級別來創建條件。我發現一箇舊的腳本,但它不再適用於modx 2.4.2:Modx revo 2.4.2獲取資源級別
<?php
/*GetLevel snippet */
$parentIds = $modx->getParentIds($modx->resource->get('id'))
return count($parentIds);
它崩潰了網站。有人可以幫助或更新上面的代碼嗎? 謝謝!