나는 이것이 충분히 간단하다고 생각합니다. 난 중첩 페이지에 대한 RoutingAutoBundle을 사용하고 싶습니다.RoutingAutoBundle이 포함 된 중첩 된 경로 (Symfony CMF)
내가 여기 함께 다음있어
http://symfony.com/doc/current/cmf/cookbook/creating_a_cms/ 내가 부모가 Page
문서를 말한다.
/**
*
* @PHPCR\Document(referenceable=true)
*
* @author Matt Durak <[email protected]>
*/
class Page implements RouteReferrersReadInterface
{
/**
* @PHPCR\Id()
*/
protected $id;
/**
* @PHPCR\ParentDocument()
*/
protected $parent;
//...
/**
* Get ID
*
* @return integer
*/
public function getId()
{
return $this->id;
}
public function getParent()
{
return $this->parent;
}
public function setParent($parent)
{
$this->parent = $parent;
return $this;
}
// ...
}
내 자동 라우팅 구성과 같이이다 : 나는 다음과 같은 것을 싶습니다
cmf_routing_auto:
mappings:
Study\MainBundle\Document\Page:
content_path:
pages:
provider: [specified, { path: /cms/routes/page }]
exists_action: auto_increment
not_exists_action: create
content_name:
provider: [content_method, { method: getTitle }]
exists_action: auto_increment
not_exists_action: create
. 나는 그렇게처럼 내 데이터를 가정
/cms/pages
/page-1
/page-2
/page-A
/page-B
현재는 이들 4 페이지는 다음과 같은 경로
있을 것 이/page/page-1
/page/page-2
/page/page-A
/page/page-B
내가 다른 content_path
에 추가하려고했습니다
/page/page-1
/page/page-2
/page/page-2/page-A
/page/page-2/page-B
싶습니다 content_object
공급자와 전화 getParent
,하지만 그 작동하지 않았다. 누구나 Symfony CMF와 RoutingAutoBundle에 익숙한가요? 문서가 희박합니다 ...
URL의 모습은 어떻습니까? (btw, 번들은 완전히 문서화되어 있지만 아직 베타 버전이므로 일부 팁과 트릭의 arricles가 누락되었습니다.) –
내가 본 루트와 내가 원하는 루트를 추가했습니다. 예, 설명서에는 기본 이상의 유용한 예제가 누락되었습니다. 그게 정말 도움이 될 것입니다 – Matt