예제 #1
0
 /**
  * @param \Leapt\AdminBundle\Admin\ContentAdmin $admin
  * @param string $action
  * @param array $params
  * @return string
  */
 public function getAdminContentPath($admin, $action, array $params = array())
 {
     if (!$admin instanceof ContentAdmin) {
         $admin = $this->getAdminByCode($admin);
     }
     return $this->contentRoutingHelper->generateUrl($admin, $action, $params);
 }
예제 #2
0
 /**
  * @param \Symfony\Component\Form\FormView $view
  * @param \Symfony\Component\Form\FormInterface $form
  * @param array $options
  */
 public function buildView(FormView $view, FormInterface $form, array $options)
 {
     $view->vars['allow_add'] = $options['allow_add'];
     if ($options['allow_add']) {
         $view->vars['add_url'] = $this->routingHelper->generateUrl($this->adminManager->getAdmin($options['admin']), 'modalCreate');
         $view->vars['add_label'] = $options['add_label'];
     }
 }
예제 #3
0
 /**
  * @param array $options
  * @return string
  */
 private function generateAddUrl(array $options)
 {
     return $this->routingHelper->generateUrl($options['admin'], 'modalCreate');
 }
예제 #4
0
 /**
  * @param DatalistActionInterface $action
  * @param $item
  * @param array $options
  * @return string
  */
 public function getUrl(DatalistActionInterface $action, $item, array $options = array())
 {
     $parameters = $this->getUrlParameters($item, $options);
     return $this->routingHelper->generateUrl($options['admin'], $options['action'], $parameters);
 }