: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Form\Element;
use Nextend\Framework\Form\AbstractField;
use Nextend\Framework\View\Html;
class Button extends AbstractField {
protected $buttonLabel = '';
protected $classes = array('n2_field_button');
public function __construct($insertAt, $name = '', $label = '', $buttonLabel = '', $parameters = array()) {
$this->buttonLabel = $buttonLabel;
parent::__construct($insertAt, $name, $label, '', $parameters);
protected function fetchElement() {
return Html::tag('a', $this->getAttributes(), $this->buttonLabel);
public function addClass($className) {
$this->classes[] = $className;
protected function getAttributes() {
'class' => implode(' ', $this->classes)
if (!empty($this->url)) {
$attributes['href'] = $this->url;
if (!empty($this->target)) {
$attributes['target'] = $this->target;
$attributes['href'] = '#';
public function setUrl($url) {
public function setTarget($target) {