<?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($mdHu1) { $this->addVariables(array('vertical' => $mdHu1)); return $this; } public function optionValues($QX8nj) { $QX8nj = array_build($QX8nj, function ($HQKqq, $mdHu1) { return array($mdHu1, $mdHu1); }); return $this->options($QX8nj); } public function options($Tpa5t) { $this->addVariables(array('options' => $Tpa5t)); return $this; } public function optionType($fUMA5) { return $this->options($fUMA5::getList()); } public function optionModel($tkusQ, $CnFib = 'id', $paeUa = 'name') { return $this->options(ModelUtil::valueMap($tkusQ, $CnFib, $paeUa)); } public function render() { $this->addCascadeScript(); return parent::render(); } }