: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Form\Element;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\View\Html;
class Radio extends AbstractFieldHidden {
protected $options = array();
protected $class = 'n2_field_radio';
protected function addScript() {
Js::addInline('new _N2.FormElementRadio("' . $this->fieldID . '", ' . json_encode(array_keys($this->options)) . ', ' . json_encode($this->relatedFields) . ');');
protected function fetchElement() {
$this->value = $this->getValue();
$html = Html::tag('div', array(
), $this->renderOptions() . parent::fetchElement());
protected function renderOptions() {
foreach ($this->options as $value => $label) {
$html .= Html::tag('div', array(
'class' => 'n2_field_radio__option' . ($this->isSelected($value) ? ' n2_field_radio__option--selected' : '')
), Html::tag('div', array(
'class' => 'n2_field_radio__option_marker'
), '<i class="ssi_16 ssi_16--check"></i>') . '<div class="n2_field_radio__option_label">' . $label . '</div>');
function isSelected($value) {
if ((string)$value == $this->value) {
public function setOptions($options) {
$this->options = $options;
public function setStyle($style) {