DefaultController.php in Shorten URLs 8.2
File
src/Controller/DefaultController.php
View source
<?php
namespace Drupal\shorten\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Render\RendererInterface;
class DefaultController extends ControllerBase {
protected $renderer;
public function __construct(RendererInterface $renderer) {
$this->renderer = $renderer;
}
public static function create(ContainerInterface $container) {
return new static($container
->get('renderer'));
}
public function shortenAdminForm() {
$form = $this
->formBuilder()
->getForm('shorten_admin');
return $this->renderer
->render($form);
}
public function shortenKeysForm() {
$form = $this
->formBuilder()
->getForm('shorten_keys');
return $this->renderer
->render($form);
}
public function shortenFormShortenForm() {
$form = $this
->formBuilder()
->getForm('shorten_form_shorten');
return $this->renderer
->render($form);
}
}