PHP-Code:
$obj = PageModel::findParentsById($GLOBALS['objPage']->id);
$class = new ReflectionClass(PageModel::findParentsById($GLOBALS['objPage']->id));
$property = $class->getProperty("arrModels");
$property->setAccessible(true);
$parents = $property->getValue($obj);
$take_parents_name = (sizeof($parents) == 4) ? true : false;
Mit diesen Models und wie ich an die protected komme bin ich nicht vertraut. So weit komme ich mit Google. Wenn ich parents ausgebe, kriege ich
[0] => Contao\PageModel Object
(
[blnDetailsLoaded: protected] =>
[arrData: protected] => Array
(
[id] => 52
[pid] => 53
[sorting] => 256
[tstamp] => 1615279709
[title] => Inhabergeführte Unternehmen / Organisationen
[alias] => inhabergefuehrte-unternehmen-organisationen
[type] => regular
[pageTitle] =>
Wie komme ich jetzt noch an [0]arrData?
Lesezeichen