当前位置: 首页>>代码示例>>PHP>>正文


PHP TbHtml::activeRadioButton方法代码示例

本文整理汇总了PHP中TbHtml::activeRadioButton方法的典型用法代码示例。如果您正苦于以下问题:PHP TbHtml::activeRadioButton方法的具体用法?PHP TbHtml::activeRadioButton怎么用?PHP TbHtml::activeRadioButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TbHtml的用法示例。


在下文中一共展示了TbHtml::activeRadioButton方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testActiveRadioButton

 public function testActiveRadioButton()
 {
     $I = $this->codeGuy;
     $html = TbHtml::activeRadioButton(new Dummy(), 'radio', array('class' => 'input', 'label' => 'Label text'));
     $body = $I->createNode($html, 'body');
     $hidden = $body->filter('input[type=hidden]');
     $I->seeNodeAttributes($hidden, array('id' => 'ytDummy_radio', 'name' => 'Dummy[radio]', 'value' => '0'));
     $label = $body->filter('label');
     $I->seeNodeCssClass($label, 'radio');
     $radio = $label->filter('input[type=radio]');
     $I->seeNodeAttributes($radio, array('class' => 'input', 'checked' => 'checked', 'id' => 'Dummy_radio', 'name' => 'Dummy[radio]', 'value' => '1'));
     $I->seeNodePattern($label, '/> Label text$/');
 }
开发者ID:AlexanderGrant1,项目名称:AC41004,代码行数:13,代码来源:TbHtmlTest.php

示例2: radioButton

 /**
  * Renders a radio button for a model attribute.
  * This method is a wrapper of {@link TbHtml::activeRadioButton}.
  * Please check {@link TbHtml::activeRadioButton} for detailed information
  * about the parameters for this method.
  * @param CModel $model the data model
  * @param string $attribute the attribute
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated radio button
  */
 public function radioButton($model, $attribute, $htmlOptions = array())
 {
     return $this->wrapControl(TbHtml::activeRadioButton($model, $attribute, $htmlOptions));
 }
开发者ID:yii-twbs,项目名称:yiistrap,代码行数:14,代码来源:TbActiveForm.php

示例3: radioButton

 /**
  * Renders a radio button for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated radio button.
  * @see TbHtml::activeRadioButton
  */
 public function radioButton($model, $attribute, $htmlOptions = array())
 {
     return TbHtml::activeRadioButton($model, $attribute, $htmlOptions);
 }
开发者ID:imanifaiz,项目名称:angular-music-db,代码行数:12,代码来源:TbActiveForm.php

示例4: testUncheckValueOptionForCheckboxesAndRadioInputs

 public function testUncheckValueOptionForCheckboxesAndRadioInputs()
 {
     $I = $this->codeGuy;
     $items = array(0);
     $model = new Dummy();
     $outputsWithHidden = array('checkbox' => TbHtml::checkBox('cb1', false, array('uncheckValue' => 1)), 'checkboxList' => TbHtml::checkBoxList('cb2', 0, $items, array('uncheckValue' => 1)), 'radio' => TbHtml::radioButton('rd1', false, array('uncheckValue' => 1)), 'radioList' => TbHtml::radioButtonList('rd2', 0, $items, array('uncheckValue' => 1)), 'activeCheckbox' => TbHtml::activeCheckBox($model, 'checkboxList'), 'activeCheckboxList' => TbHtml::activeCheckBoxList($model, 'checkboxList', $items), 'activeRadio' => TbHtml::activeRadioButton($model, 'radioList'), 'activeRadioList' => TbHtml::activeRadioButtonList($model, 'radioList', $items));
     foreach ($outputsWithHidden as $output) {
         $I->seeNodeChildren($I->createNode($output), array('input[type=hidden]'));
     }
     // comparing against null 'uncheckValue' option
     $noHiddenOptions = array('uncheckValue' => null);
     $outputsWithoutHidden = array('checkbox' => TbHtml::checkBox('cb1'), 'checkboxList' => TbHtml::checkBoxList('cb2', 0, $items), 'radio' => TbHtml::radioButton('rd1'), 'radioList' => TbHtml::radioButtonList('rd2', 0, $items), 'activeCheckbox' => TbHtml::activeCheckBox($model, 'checkboxList', $noHiddenOptions), 'activeCheckboxList' => TbHtml::activeCheckBoxList($model, 'checkboxList', $items, $noHiddenOptions), 'activeRadio' => TbHtml::activeRadioButton($model, 'radioList', $noHiddenOptions), 'activeRadioList' => TbHtml::activeRadioButtonList($model, 'radioList', $items, $noHiddenOptions));
     foreach ($outputsWithoutHidden as $output) {
         $I->dontSeeNodeChildren($I->createNode($output), array('input[type=hidden]'));
     }
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:16,代码来源:TbHtmlTest.php


注:本文中的TbHtml::activeRadioButton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。