You are here

public function AmpFormTrait::widthError in Accelerated Mobile Pages (AMP) 8.3

See if selected width is invalid based on the selected layout.

Parameters

integer $width: The setting value.

Return value

bool Either TRUE or FALSE.

1 call to AmpFormTrait::widthError()
AmpFormTrait::addToSummary in src/AmpFormTrait.php
Update the summary.

File

src/AmpFormTrait.php, line 183

Class

AmpFormTrait
AMP Form trait.

Namespace

Drupal\amp

Code

public function widthError($width, $layout) {

  // If the selected layout expects a numeric value and the current value is
  // empty, the width is invalid.
  return empty($width) && $this
    ->validWidth(1, $layout) == 1;
}