API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...

Problem/Motivation

There is a missing quote after #value on the Usage example:

<?php
$form['actions']['preview'] = array(
  '#type' => 'button',
  '#value => $this->t('Preview'),
);
?>

Proposed resolution

Should be:

<?php
$form['actions']['preview'] = array(
  '#type'  => 'button',
  '#value' => $this->t('Preview'),
);
?>
CommentFileSizeAuthor
#5 missing_quote_example_2667606_5.patch442 bytesAchillesKal

Comments

AchillesKal created an issue. See original summary.

AchillesKal’s picture

Issue summary: View changes
AchillesKal’s picture

Issue summary: View changes
AchillesKal’s picture

Issue summary: View changes
AchillesKal’s picture

Status: Active » Needs review
StatusFileSize
new442 bytes

Here's the patch.

jhodgdon’s picture

Title: Missing single quote on the usage example » Missing single quote on the Buttons element usage example
Status: Needs review » Reviewed & tested by the community

Thanks for the issue and patch!

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!

  • catch committed 65ad272 on 8.1.x
    Issue #2667606 by AchillesKal: Missing single quote on the Buttons...

  • catch committed f2516bb on 8.0.x
    Issue #2667606 by AchillesKal: Missing single quote on the Buttons...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.