<?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($gwXrh) { $this->addVariables(array('vertical' => $gwXrh)); return $this; } public function optionValues($i5Ynu) { $i5Ynu = array_build($i5Ynu, function ($rvTrU, $gwXrh) { return array($gwXrh, $gwXrh); }); return $this->options($i5Ynu); } public function options($C87JF) { $this->addVariables(array('options' => $C87JF)); return $this; } public function optionType($nsF6n) { return $this->options($nsF6n::getList()); } public function optionModel($Beeb4, $bZCgI = 'id', $sb8RM = 'name') { return $this->options(ModelUtil::valueMap($Beeb4, $bZCgI, $sb8RM)); } public function render() { $this->addCascadeScript(); return parent::render(); } }