Anybody please let me know how to define a "toOptionArray()" kind of function in Magento 2 such that any "array" (I have "array" formatted data not object[] format) can be defined and assigned to Admin custom form "select" field.
Like below:
public function getBannerEffects()
{
return array(
array('value' => 'none', 'label'=>__('None')),
array('value' => 'blindX', 'label'=>__('Blind X')),
array('value' => 'blindY', 'label'=>__('Blind Y')),
array('value' => 'blindZ', 'label'=>__('Blind Z')),
array('value' => 'cover', 'label'=>__('Cover')),
array('value' => 'curtainX', 'label'=>__('Curtain X')),
array('value' => 'curtainY', 'label'=>__('Curtain Y')),
array('value' => 'fade', 'label'=>__('Fade')),
array('value' => 'fadeZoom', 'label'=>__('Fade Zoom')),
array('value' => 'growX', 'label'=>__('Grow X')),
array('value' => 'growY', 'label'=>__('Grow Y')),
array('value' => 'scrollUp', 'label'=>__('Scroll Up')),
array('value' => 'scrollDown', 'label'=>__('Scroll Down')),
array('value' => 'scrollLeft', 'label'=>__('Scroll Left')),
array('value' => 'scrollRight', 'label'=>__('Scroll Right')),
array('value' => 'scrollHorz', 'label'=>__('Scroll Horizontal')),
array('value' => 'scrollVert', 'label'=>__('Scroll Vertical')),
array('value' => 'shuffle', 'label'=>__('Shuffle')),
array('value' => 'toss', 'label'=>__('Toss')),
array('value' => 'turnUp', 'label'=>__('Turn Up')),
array('value' => 'turnDown', 'label'=>__('Turn Down')),
array('value' => 'turnLeft', 'label'=>__('Turn Left')),
array('value' => 'turnRight', 'label'=>__('Turn Right')),
array('value' => 'uncover', 'label'=>__('Uncover')),
array('value' => 'wipe', 'label'=>__('Wipe')),
array('value' => 'zoom', 'label'=>__('Zoom'))
);
}
Can this be declared in Model or Helper ?
How to assign this data to custom module Admin panel form "select" field ?