public function edit($content)
    {
        if (!array_key_exists('selectOptions', $this->_editViewData)) {
            $this->_editViewData['selectOptions'] = [];
            $selectOptions = BlockSelectOption::where('block_id', '=', $this->_block->id)->get();
            foreach ($selectOptions as $selectOption) {
                $this->_editViewData['selectOptions'][$selectOption->value] = $selectOption->option;
            }
            if (preg_match('/^#[a-f0-9]{6}$/i', key($selectOptions))) {
                $this->_editViewData['class'] = 'select_colour';
            }
        }
        return parent::edit($content);
    }
public function edit($content)
    {
        if (!array_key_exists('selectOptions', $this->_editViewData)) {
            $this->_editViewData['selectOptions'] = [];
            $selectOptions = BlockSelectOption::where('block_id', '=', $this->_block->id)->get();
            foreach ($selectOptions as $selectOption) {
                $this->_editViewData['selectOptions'][$selectOption->value] = $selectOption->option;
            }
            if (preg_match('/^#[a-f0-9]{6}$/i', key($selectOptions))) {
                $this->_editViewData['class'] = 'select_colour';
            }
        }
        return parent::edit($content);
    }
public function edit ( $ content ) { if ( ! array_key_exists ( 'selectOptions' , $ this -> _editViewData ) ) { $ this -> _editViewData [ 'selectOptions' ] = [ ] ; $ selectOptions = BlockSelectOption :: where ( 'block_id' , '=' , $ this -> _block -> id ) -> get ( ) ; foreach ( $ selectOptions as $ selectOption ) { $ this -> _editViewData [ 'selectOptions' ] [ $ selectOption -> value ] = $ selectOption -> option ; } if ( preg_match ( '/^#[a-f0-9]{6}$/i' , key ( $ selectOptions ) ) ) { $ this -> _editViewData [ 'class' ] = 'select_colour' ; } } return parent :: edit ( $ content ) ; }
Display select options, will fill in bg colour if hexadecimal
@param string $content
@return string
Display select options will fill in bg colour if hexadecimal