public NodeForm::preview(array $form, FormStateInterface $form_state)
Form submission handler for the 'preview' action.
Parameters
$form: An associative array containing the structure of the form.
$form_state: The current state of the form.
File
- core/modules/node/src/NodeForm.php, line 340
Class
- NodeForm
- Form handler for the node edit forms.
Namespace
Drupal\node
Code
1 2 3 4 5 6 7 8 9 | public function preview( array $form , FormStateInterface $form_state ) { $store = $this ->tempStoreFactory->get( 'node_preview' ); $this ->entity->in_preview = TRUE; $store ->set( $this ->entity->uuid(), $form_state ); $form_state ->setRedirect( 'entity.node.preview' , array ( 'node_preview' => $this ->entity->uuid(), 'view_mode_id' => 'default' , )); } |
Please login to continue.