Example #1
0
 /**
  * @param Tag $tag
  * @return \Symfony\Component\Form\Form
  */
 private function createDeleteTagForm(Tag $tag)
 {
     return $this->createFormBuilder()->setAction($this->generateUrl('delete-tag', array('id' => $tag->getId())))->setMethod('DELETE')->getForm();
 }
 /**
  * {@inheritDoc}
  */
 public function getId()
 {
     if ($this->__isInitialized__ === false) {
         return (int) parent::getId();
     }
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());
     return parent::getId();
 }
 /**
  * Creates a form to delete a Tag entity.
  *
  * @param Tag $tag The Tag entity
  *
  * @return \Symfony\Component\Form\Form The form
  */
 private function createDeleteForm(Tag $tag)
 {
     return $this->createFormBuilder()->setAction($this->generateUrl('admin_tag_delete', array('id' => $tag->getId())))->setMethod('DELETE')->add('submit', SubmitType::class, ['label' => ' ', 'attr' => ['class' => 'glyphicon glyphicon-trash btn-link']])->getForm();
 }
Example #4
0
 public function createTagDeleteForm(Tag $tag)
 {
     //$builder = $this->formFactory->createBuilder();
     $form = $this->builder->setAction($this->router->generate('remove_tag', array('id' => $tag->getId())))->setMethod('DELETE')->add('submit', SubmitType::class, ['label' => ' ', 'attr' => ['class' => 'glyphicon glyphicon-trash btn-link']])->getForm();
     return $form;
 }
Example #5
0
 /**
  * Creates a form to delete a Post entity.
  *
  * @param Tag $tag The Tag entity
  *
  * @return \Symfony\Component\Form\Form The form
  */
 private function createDeleteForm(Tag $tag)
 {
     return $this->createFormBuilder()->setAction($this->generateUrl('admin_tag_delete', array('id' => $tag->getId())))->setMethod('DELETE')->add('submit', SubmitType::class, ['label' => ' ', 'attr' => ['class' => 'btn btn-xs btn-danger ace-icon fa fa-trash-o bigger-120']])->getForm();
 }
 /**
  * Returns tag
  *
  * @ApiDoc(
  *     views={"default", "tag"},
  *     section="Tag API",
  *     statusCodes={
  *         200="Returned when successful",
  *         400="Returned when an error has occurred"
  *     },
  *     responseMap={
  *         200 = {"class": null, "options": {"data_schema": "tag.schema.yml"}}
  *     }
  * )
  *
  * @Route("tags/{tag}", name="api_tag_get_tag", requirements={
  *     "_scope":  "[\w,]+"
  * }, defaults={"_format": "json"}, methods={"GET"})
  *
  * @RestExtra\Scope(name="list", path="tag/view.yml")
  *
  * @param Tag $tag
  * @param ScopeFetcherInterface $scopeFetcher
  * @param Request $request
  * @return View
  */
 public function getTagAction(Tag $tag, ScopeFetcherInterface $scopeFetcher, Request $request)
 {
     $datagridBuilder = $this->get('glavweb_datagrid.doctrine_datagrid_builder');
     $datagridBuilder->setEntityClassName(Tag::class)->setDataSchema('tag.schema.yml', $scopeFetcher->getAvailable($request->get('_scope'), 'tag/view.yml'))->addFilter('id', null, ['operator' => Filter::EQ]);
     $datagrid = $datagridBuilder->build(['id' => $tag->getId()]);
     return $this->view($datagrid->getItem());
 }