public function ConfigPagesController::addForm in Config Pages 8
Same name and namespace in other branches
- 8.3 src/Controller/ConfigPagesController.php \Drupal\config_pages\Controller\ConfigPagesController::addForm()
- 8.2 src/Controller/ConfigPagesController.php \Drupal\config_pages\Controller\ConfigPagesController::addForm()
Presents the config page creation form.
Parameters
\Drupal\config_pages\ConfigPagesTypeInterface $config_pages_type: The config page type to add.
\Symfony\Component\HttpFoundation\Request $request: The current request object.
Return value
array A form array as expected by drupal_render().
File
- src/
Controller/ ConfigPagesController.php, line 87
Class
Namespace
Drupal\config_pages\ControllerCode
public function addForm(ConfigPagesTypeInterface $config_pages_type, Request $request) {
$config_page = $this->ConfigPagesStorage
->create([
'type' => $config_pages_type
->id(),
]);
return $this
->entityFormBuilder()
->getForm($config_page);
}