<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Util\ConvertUtil; use ModStart\Field\Concern\CanCascadeFields; use ModStart\Field\Type\FieldRenderMode; class Radio extends AbstractField { use CanCascadeFields; protected function setup() { $this->addVariables(array('vertical' => false, 'options' => array())); } public function vertical($wvO30) { $this->addVariables(array('vertical' => $wvO30)); return $this; } public function optionValues($kB0Us) { $kB0Us = array_build($kB0Us, function ($dwwIV, $wvO30) { return array($wvO30, $wvO30); }); return $this->options($kB0Us); } public function options($ZNmAK) { $this->addVariables(array('options' => $ZNmAK)); return $this; } public function optionType($q5sLX) { return $this->options($q5sLX::getList()); } public function optionModel($oAD_e, $aKi50 = 'id', $TcL6O = 'name') { return $this->options(ModelUtil::valueMap($oAD_e, $aKi50, $TcL6O)); } public function render() { $this->addCascadeScript(); return parent::render(); } }