class RobotAddForm
Same name in other branches
- 3.x modules/config_entity_example/src/Form/RobotAddForm.php \Drupal\config_entity_example\Form\RobotAddForm
- 4.0.x modules/config_entity_example/src/Form/RobotAddForm.php \Drupal\config_entity_example\Form\RobotAddForm
Class RobotAddForm.
Provides the add form for our Robot entity.
Hierarchy
- class \Drupal\config_entity_example\Form\RobotFormBase extends \Drupal\Core\Entity\EntityForm
- class \Drupal\config_entity_example\Form\RobotAddForm extends \Drupal\config_entity_example\Form\RobotFormBase
Expanded class hierarchy of RobotAddForm
Related topics
File
-
config_entity_example/
src/ Form/ RobotAddForm.php, line 14
Namespace
Drupal\config_entity_example\FormView source
class RobotAddForm extends RobotFormBase {
/**
* Returns the actions provided by this form.
*
* For our add form, we only need to change the text of the submit button.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* An associative array containing the current state of the form.
*
* @return array
* An array of supported actions for the current entity form.
*/
protected function actions(array $form, FormStateInterface $form_state) {
$actions = parent::actions($form, $form_state);
$actions['submit']['#value'] = $this->t('Create Robot');
return $actions;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
RobotAddForm::actions | protected | function | Returns the actions provided by this form. | Overrides RobotFormBase::actions |
RobotFormBase::$entityStorage | protected | property | An entity query factory for the robot entity type. | |
RobotFormBase::buildForm | public | function | Overrides Drupal\Core\Entity\EntityFormController::form(). | |
RobotFormBase::create | public static | function | Factory method for RobotFormBase. | |
RobotFormBase::exists | public | function | Checks for an existing robot. | |
RobotFormBase::save | public | function | Overrides Drupal\Core\Entity\EntityFormController::save(). | |
RobotFormBase::validateForm | public | function | ||
RobotFormBase::__construct | public | function | Construct the RobotFormBase. |