我在我的内容树中有两个页面sulu 1.0.13。在页面“A”上,我通过内容类型为“单一内部链接”的字段设置了页面“B”的引用。Sulu cmf获取引用者
当我在页面“B”时,我想获得引用页面“A”。我在我的控制器中试过以下代码:
$dm = $this->get('sulu_document_manager.document_manager');
$doc = $dm->find('992758cf-1da4-4e45-9ee4-ca9c4ec3998e'); // UUID of page "B"
$di = $this->get('sulu_document_manager.document_inspector');
$node = $di->getNode($doc);
$refs = $di->getReferrers($doc); // $refs is an empty collection
$refs = $node->getReferences(); // $refs is an empty collection
$refs = $node->getWeakReferences(); // $refs is an empty collection
$ refs始终是一个空集合。
什么是正确的方式来获取推荐页面?
更新:我现在使用的版本1.1.0 RC2
你的问题并不十分清楚。请更清楚地描述您的问题,并尝试自行解决问题。 – Greg