Commit bb2cdb26 authored by alexpott's avatar alexpott

Issue #1979034 by plopesc: Convert views_test_data_element_form() to a Controller.

parent 127538ee
<?php
/**
* @file
* Contains \Drupal\views_test_data\Form\ViewsTestDataElementForm.
*/
namespace Drupal\views_test_data\Form;
use Drupal\Core\Form\FormInterface;
/**
* Simple form page callback to test the view element.
*/
class ViewsTestDataElementForm implements FormInterface {
/**
* {@inheritdoc}
*/
public function getFormID() {
return 'views_test_data_element_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$form['view'] = array(
'#type' => 'view',
'#name' => 'test_view',
'#display_id' => 'default',
'#arguments' => array(25),
);
return $form;
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, array &$form_state) {
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
}
}
......@@ -129,34 +129,3 @@ function template_preprocess_views_view_mapping_test(&$variables) {
function theme_views_view_mapping_test($variables) {
return drupal_render($variables['element']);
}
/**
* Implements hook_menu().
*/
function views_test_data_menu() {
$items = array();
$items['views_test_data_element_form'] = array(
'title' => 'Views test data element form',
'description' => 'Views test data element form callback',
'page callback' => 'drupal_get_form',
'page arguments' => array('views_test_data_element_form'),
'access callback' => TRUE,
);
return $items;
}
/**
* Simple form page callback to test the view element.
*/
function views_test_data_element_form() {
$form['view'] = array(
'#type' => 'view',
'#name' => 'test_view',
'#display_id' => 'default',
'#arguments' => array(25),
);
return $form;
}
views_test_data_element:
pattern: '/views_test_data_element_form'
defaults:
_form: '\Drupal\views_test_data\Form\ViewsTestDataElementForm'
requirements:
_access: 'TRUE'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment