You are here

public function LogController::add in Log entity 8

Provides the log submission form.

Parameters

\Drupal\log\LogTypeInterface $log_type: The log type entity for the log.

Return value

array A log submission form.

1 string reference to 'LogController::add'
log.routing.yml in ./log.routing.yml
log.routing.yml

File

src/Controller/LogController.php, line 113
Contains \Drupal\log\Controller\LogController.

Class

LogController
Returns responses for Log routes.

Namespace

Drupal\log\Controller

Code

public function add(LogTypeInterface $log_type) {
  $log = $this
    ->entityManager()
    ->getStorage('log')
    ->create(array(
    'type' => $log_type
      ->id(),
  ));
  $form = $this
    ->entityFormBuilder()
    ->getForm($log);
  return $form;
}