Example #1
0
 public function execute(WidgetInterface $widget)
 {
     $model = $this->repository->findOneBy(['id' => $widget->getOption('form_builder_id')]);
     if (!$model) {
         return sprintf('Form Builder #%s not found.', $widget->getOption('form_builder_id'));
     }
     $form = $this->factory->build($model);
     return $this->render($widget, ['form' => $form->createView()]);
 }
 public function execute(WidgetInterface $widget)
 {
     $maxEvents = $widget->getOption('max_events');
     $events = $this->repository->getUpcomingEvents($maxEvents);
     $this->render('@SymEdit/Widget/Events/upcoming_events.html.twig', ['events' => $events]);
 }
 /**
  * @return ImageGalleryInterface
  */
 protected function getGallery(WidgetInterface $widget)
 {
     return $this->repository->findOneBy(['slug' => $widget->getOption('slider')]);
 }
Example #4
0
 public function execute(WidgetInterface $widget)
 {
     $form = $this->formFactory->create(new SubscribeType(), null, ['action' => $this->router->generate('symedit_mailchimp_subscribe'), 'method' => 'POST', 'list' => $widget->getOption('list')]);
     return $this->render($widget, ['form' => $form->createView(), 'placeholder' => $widget->getOption('placeholder'), 'button_text' => $widget->getOption('button_text')]);
 }
Example #5
0
 public function execute(WidgetInterface $widget, PageInterface $page = null)
 {
     $address = $widget->getOption('address');
     return $this->render($widget, ['query' => empty($address) ? null : $address]);
 }
 /**
  * {@inheritdoc}
  */
 public function render(WidgetInterface $widget, array $parameters = [])
 {
     return $this->templating->render($widget->getOption('template'), $parameters);
 }
Example #7
0
 public function execute(WidgetInterface $widget)
 {
     $posts = $this->postRepository->getRecent($widget->getOption('max'));
     return $this->render($widget, ['posts' => $posts]);
 }