AppBundle\Entity\Post::getSlug PHP Method

getSlug() public method

public getSlug ( )
    public function getSlug()
    {
        return $this->slug;
    }

Usage Example

Example #1
0
 /**
  * @Route("/mark/{postSlug}/new", name = "mark_new")
  * @Method("POST")
  * @ParamConverter("post", options={"mapping": {"postSlug": "slug"}})
  */
 public function markNewAction(Post $post, Request $request)
 {
     $form = $this->createForm(MarkType::class);
     $form->handleRequest($request);
     if ($form->isSubmitted() && $form->isValid()) {
         $mark = $form->getData();
         $entityManager = $this->getDoctrine()->getManager();
         $post->addMark($mark['mark']);
         $entityManager->flush();
         return $this->redirectToRoute('blog_post', array('slug' => $post->getSlug()));
     }
     return $this->render('blog/_mark_form.html.twig', array('post' => $post, 'form' => $form->createView()));
 }
All Usage Examples Of AppBundle\Entity\Post::getSlug