<?php
namespace Coddict\WebsiteBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller,
Symfony\Component\HttpFoundation\Response,
Sonata\BlockBundle\Model\BlockInterface;
class PageController extends Controller
{
public function renderAction($contentDocument = null) {
//This line alone returns null
$contentDocument->category;
//But if i get the page from the manager first, it works...
//This line works
$dm = $this->get('doctrine_phpcr')->getManager();
$dm->find(null,$contentDocument->path);
//returns the category
$contentDocument->category;
return $this->render("::categorypage.html.twig",array("category" => $contentDocument->category, "page" => $contentDocument));
}
}