Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CRUD
- php bin/console generate:doctrine:crud --entity=CarBundle:Car --format=annotation --with-write --no-interaction
- -CarController
- annotation
- /**
- *List all Car entities.
- *
- * @Route("/", name="car_index")
- * @Method("Get")
- * @Template() ++++++++++++
- */
- public function indexAction()
- {
- $em = $this->getDoctrine()->getManaget();
- $cars = $em->getRepository('Car')->findAll();
- return array(
- 'cars' => $cars
- );
- }
- **********************
- u Madel class ubacujemo
- public function __toString()
- {
- return $this->getName();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement