<?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($cBDsM) { $this->addVariables(array('vertical' => $cBDsM)); return $this; } public function optionValues($aJd3g) { $aJd3g = array_build($aJd3g, function ($oMJcb, $cBDsM) { return array($cBDsM, $cBDsM); }); return $this->options($aJd3g); } public function options($Ho5Xg) { $this->addVariables(array('options' => $Ho5Xg)); return $this; } public function optionType($cxdWJ) { return $this->options($cxdWJ::getList()); } public function optionModel($loNjC, $WoS8y = 'id', $tYSg7 = 'name') { return $this->options(ModelUtil::valueMap($loNjC, $WoS8y, $tYSg7)); } public function render() { $this->addCascadeScript(); return parent::render(); } }