Answers for "buttons in php"

PHP
2

buttons in php

class StargazerButton extends \atk4\ui\Button {

  public $model;
  public $label;

  function init() {
    parent::init();

    $this->add(new Button(['Stars', 'basic blue', 'icon'=>'star']));
    $this->label = $this->add(new Label($model['stars'], ['basic blue left pointing']));

    $this->on('click', function() {
      $this->model['stars']++;
      $this->model->save();
      return $this->reload();
    });
  }
}
Posted by: Guest on August-12-2020

Browse Popular Code Answers by Language