I am trying to get the orgid from the form so I can pass it to the Ormember:test Controller:Action as outlined in my.html.twig using:
{{ render(controller(
'CompanyNameofBundle:OrgMember:test', {'orgid':1})) }}
Where for now there is a static "1" but I would like to be a variable.
my.html.twig
{% extends 'CompanyNameofBundle::base.html.twig' %}
{% block body -%}
<h1>Organization Edit</h1>
{{ form(edit_form, {'attr': {'novalidate': 'novalidate'}}) }}
<ul class="record_actions">
<li>
<a href="{{ path('org') }}">
Back to the list
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{{ render(controller(
'CompanyNameofBundle:Search:shortjq')) }}
{{ render(controller(
'CompanyNameofBundle:OrgMember:test', {'orgid':1})) }}
{% endblock %}
OrgController.php
/**
* Org controller.
*
* @Route("/org")
*/
class OrgController extends Controller
{
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CompanyNameofBundle:Org')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Org entity.');
}
$editForm = $this->createEditForm($entity);
$deleteForm = $this->createDeleteForm($id);
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
}
Org.php (Entity)
/**
* Org
*/
class Org
{
/**
* @var string
*/
private $orgName;
/**
* @var integer
*/
private $orgId;
/** of course setters and getters for above */
}