<?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($Gttsd) { $this->addVariables(array('vertical' => $Gttsd)); return $this; } public function optionValues($q2nIJ) { $q2nIJ = array_build($q2nIJ, function ($jPfeB, $Gttsd) { return array($Gttsd, $Gttsd); }); return $this->options($q2nIJ); } public function options($nO0o6) { $this->addVariables(array('options' => $nO0o6)); return $this; } public function optionType($PbprP) { return $this->options($PbprP::getList()); } public function optionModel($wt8xl, $AWXu8 = 'id', $mfJsz = 'name') { return $this->options(ModelUtil::valueMap($wt8xl, $AWXu8, $mfJsz)); } public function render() { $this->addCascadeScript(); return parent::render(); } }