I am attempting to render an action from within twig to list results of a table. The first variable is passing through fine and I am getting the list populated, but the second variable is not arriving.
{% render 'RiskAssessmentBundle:Assessment:assessmentlist' with {'offenderId': entity.getId, 'assessmentStatus': 'Complete' } %}
Above is the render call in my twig template. offenderId is arriving with a value.
/**
* List widget
*
* @param int $offenderId id of the offender
* @param string $assessmentStatus const value of desired status
*
* @Template("RiskAssessmentBundle:Assessment:assessmentlist.html.twig")
*/
public function assessmentlistAction($offenderId, $assessmentStatus = null)
{
var_dump($assessmentStatus);
$em = $this->getDoctrine()->getEntityManager();
$offender = $em->getRepository('RiskOffenderBundle:Offender')->find($offenderId);
if (is_null($assessmentStatus)) {
$assessments = $em->getRepository('RiskAssessmentBundle:Assessment')
->findAllByActive(true, $offenderId, 5);
} else {
$assessments = $em->getRepository('RiskAssessmentBundle:Assessment')
->findAllByStatus($assessmentStatus, $offenderId, 5);
}
return array(
'assessments' => $assessments,
'offender' => $offender,
);
}
Above is the action called. The var_dump of the $assessmentStatus is always NULL. I am new to symfony, but every piece of documentation I can find makes me think this should work. Anyone have a clue what I am doing wrong?