toArray(); foreach ($array as $key => $value) { $optionArray[] = ['value' => $key, 'label' => $value]; } return $optionArray; } /** * @return array */ public function toArray() { return [ 'center' => __('Center'), 'top' => __('Top'), 'bottom' => __('Bottom'), ]; } }