YesNo.php 438 B

12345678910111213141516171819202122
  1. <?php
  2. namespace common\libs\dataList\column;
  3. class YesNo extends AbstractColumn implements InterfaceColumn {
  4. public $label = [
  5. 'yes' => 'Yes',//yes
  6. 'no' => 'No',//NO
  7. ];
  8. public function __construct($config = []) {
  9. parent::__construct($config);
  10. }
  11. public function result(){
  12. $value = $this->getValue();
  13. return ($value == 1) ? $this->label['yes'] : $this->label['no'];
  14. }
  15. }