input->setAttributes( [ 'min' => $config['min'] ] ); } if ( isset( $config['max'] ) ) { $this->input->setAttributes( [ 'max' => $config['max'] ] ); } $this->input->setAttributes( [ 'step' => $config['step'] ?? 'any' ] ); if ( isset( $config['buttonStep'] ) ) { $this->buttonStep = $config['buttonStep']; } if ( isset( $config['pageStep'] ) ) { $this->pageStep = $config['pageStep']; } if ( isset( $config['showButtons'] ) ) { $this->showButtons = $config['showButtons']; } $this->addClasses( [ 'oo-ui-numberInputWidget', 'oo-ui-numberInputWidget-php', ] ); } public function getConfig( &$config ) { $min = $this->input->getAttribute( 'min' ); if ( $min !== null ) { $config['min'] = $min; } $max = $this->input->getAttribute( 'max' ); if ( $max !== null ) { $config['max'] = $max; } $step = $this->input->getAttribute( 'step' ); if ( $step !== 'any' ) { $config['step'] = $step; } if ( $this->pageStep !== null ) { $config['pageStep'] = $this->pageStep; } if ( $this->buttonStep !== null ) { $config['buttonStep'] = $this->buttonStep; } if ( $this->showButtons !== null ) { $config['showButtons'] = $this->showButtons; } return parent::getConfig( $config ); } }