Skip to content
Viames Marino edited this page Feb 26, 2026 · 2 revisions

Pair framework: Meter

Pair\Html\FormControls\Meter renders an HTML <meter> element.

Methods

  • min(int|float $minValue): self
  • max(int|float $maxValue): self
  • low(int|float $lowValue): self
  • high(int|float $highValue): self
  • optimum(int|float $optimumValue): self
  • render(): string

Behavior

  • Caption text is rendered between opening and closing <meter> tags.
  • value(...) and caption(...) are inherited from FormControl.

Example

$quality = (new \Pair\Html\FormControls\Meter('quality'))
    ->value(72)
    ->min(0)
    ->max(100)
    ->low(30)
    ->high(80)
    ->optimum(90)
    ->caption('72%');

echo $quality->render();

Notes

Current implementation always renders value and max attributes. The internal min, low, high, optimum properties are settable but are not currently emitted as HTML attributes by render().

See also: Progress, Number, FormControl.

Clone this wiki locally