Whenever i use classname extends FormBase the clear cache crashes and whenever i remove it it works again.
<?php
namespace Drupal\API_crud\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class ApiCrud extends FormBase {
public function getFormId() {
return 'api_form';
}
public function buidForm(array $form, FormStateInterface $form_state) {
$form['title'] = [
'#type' => 'textfield',
'#title' => $this->t('API: '),
'#required' => TRUE,
];
$form['actions'] = [
'#type' => 'actions',
];
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Submit'),
];
return $form;
}
}
apiAuth.form:
path: '/apiAuth'
defaults:
_form: '\Drupal\API_crud\Form\ApiCrud'
# _controller: '\Drupal\API_crud\Controller\apiCrudController::Welcome'
_title: 'API_Authentication'
requirements:
_permission: 'access content'
FormInterface
, and you would've fixed it quickly.