Commit e4a25baf authored by Mat's avatar Mat
Browse files

Déplace/renomme -> OffreLegumesController/ajaxDisplayAction

parent 5bb5e543
......@@ -3,7 +3,6 @@
namespace PotageBundle\Controller;
use APIBundle\Form\OffreAPIType;
use APIBundle\Form\OffreLegumesAPIType;
class OffreController extends MasterController
{
......@@ -19,25 +18,4 @@ class OffreController extends MasterController
));
}
/**
* @param $id
* @return \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* @throws \Doctrine\ORM\NonUniqueResultException
*/
public function readOneAction($id)
{
$offre = $this->getDoctrine()->getManager()
->getRepository('PotageBundle:Offre')->findOneForAPIRead($id);
if ($offre === null) {
return $this->createNotFoundException('Non trouvé');
}
$form = $this->createForm(OffreLegumesAPIType::class);
return $this->render('@Potage/OffreLegumes/ajaxDisplay.html.twig', array(
'id' => $id,
'offre' => $offre,
'formOffreLegumes' => $form->createView()
));
}
}
......@@ -2,11 +2,31 @@
namespace PotageBundle\Controller;
use APIBundle\Form\OffreLegumesAPIType;
class OffreLegumesController extends MasterController
{
/**
* @param $id
* @return \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* @throws \Doctrine\ORM\NonUniqueResultException
*/
public function ajaxDisplayAction($id)
{
$offre = $this->getDoctrine()->getManager()
->getRepository('PotageBundle:Offre')->findOneForAPIRead($id);
if ($offre === null) {
return $this->createNotFoundException('Non trouvé');
}
$form = $this->createForm(OffreLegumesAPIType::class);
return $this->render('@Potage/OffreLegumes/ajaxDisplay.html.twig', array(
'id' => $id,
'offre' => $offre,
'formOffreLegumes' => $form->createView()
));
}
}
......@@ -22,6 +22,6 @@ potage_offre_legumes_ajax_display:
requirements:
id: \d+
defaults:
_controller: PotageBundle:Offre:readOne
_controller: PotageBundle:OffreLegumes:ajaxDisplay
methods: [ GET ]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment