本文整理汇总了PHP中CHtml::activeRadioButton方法的典型用法代码示例。如果您正苦于以下问题:PHP CHtml::activeRadioButton方法的具体用法?PHP CHtml::activeRadioButton怎么用?PHP CHtml::activeRadioButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHtml
的用法示例。
在下文中一共展示了CHtml::activeRadioButton方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
if (Yii::app()->getRequest()->getIsAjaxRequest() and $_GET['ajax'] == 1) {
$response = array();
$model = new AAddress();
$model->city = 'Bengaluru';
//get localities list -start
$modelArr = ABangaloreLocalities::model()->findAll(array('condition' => 'is_deleted = "no"', 'order' => 'locality_name ASC'));
$locality_array = array();
foreach ($modelArr as $singleModel) {
$locality_array[$singleModel->id] = $singleModel->locality_name;
}
$locality_array[""] = "Select any area";
//get localities list -stop
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['AAddress'])) {
$model->attributes = $_POST['AAddress'];
$currDateTime = new DateTime();
$model->creation_time = $currDateTime->format('Y-m-d H:i:s');
$model->link = AppCommon::getUserDetailsId();
$model->link_table = "user_details";
if ($model->save()) {
//$this->redirect(array('view','id'=>$model->id));
//sending row html code with checked radio button
$response["isRecordSaved"] = 1;
$id_temp = $model->id;
$Loc_name_temp = $model->address2bangaloreLocalities->locality_name;
$address_temp = $model->getAddressString();
$response["html"] = '<tr><td>' . CHtml::activeRadioButton(new CheckoutFirstStageForm(), 'address', array('value' => $id_temp, 'required' => true, 'checked' => true, 'data-locality_name' => $Loc_name_temp, 'uncheckValue' => NULL)) . '</td><td>' . $address_temp . '</td><td>' . $Loc_name_temp . '</td><tr>';
$response["locality"] = $Loc_name_temp;
echo CJSON::encode($response);
Yii::app()->end();
}
}
$response["html"] = $this->renderPartial('create', array('model' => $model, 'locality_array' => $locality_array), true, false);
$response["isRecordSaved"] = 0;
echo CJSON::encode($response);
Yii::app()->end();
}
}
示例2: activeRadioButton
/**
* Generates 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.
*/
public static function activeRadioButton($model, $attribute, $htmlOptions = array())
{
$label = TbArray::popValue('label', $htmlOptions, false);
$labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());
self::addCssClass('radio', $labelOptions);
$input = parent::activeRadioButton($model, $attribute, $htmlOptions);
return self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions);
}
示例3: array
<div class="image_block">
<?php
echo CHtml::link(CHtml::image("/images/admin/del.png", "Удалить"), Yii::app()->createUrl('/news/default/deleteImage', array("id" => $data->id)), array('id' => $data->id, 'class' => 'deletePhoto'));
?>
<div class="image">
<a href="<?php
echo '/' . $folder_upload . $data->filename;
?>
" class="thumb" rel="example_group">
<span>
<?php
echo CHtml::image('/' . $folder_upload . $data->filename);
?>
</span>
</a>
</div>
<?php
if ($data->id == $cover_id) {
echo CHtml::activeRadioButton($data, 'id', array('value' => $data->id, 'uncheckValue' => null, 'checked' => 'checked'));
echo CHtml::label('Обложка', 'for');
} else {
echo CHtml::activeRadioButton($data, 'id', array('value' => $data->id, 'uncheckValue' => null, 'checked' => ''));
echo CHtml::label('Сделать обложкой', 'for');
}
?>
</div>
示例4: run
/**
* (non-PHPdoc)
* @see framework/CWidget::run()
*/
public function run()
{
$cs = Yii::app()->getClientScript();
list($name, $id) = $this->resolveNameID();
if (isset($this->htmlOptions['id'])) {
$id = $this->htmlOptions['id'];
} else {
$this->htmlOptions['id'] = $id;
}
if (isset($this->htmlOptions['name'])) {
$name = $this->htmlOptions['name'];
} else {
$this->htmlOptions['name'] = $name;
}
if ($this->buttonType == 'buttonset') {
echo CHtml::closeTag($this->htmlTag);
$cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').buttonset();");
} else {
switch ($this->buttonType) {
case 'submit':
echo CHtml::submitButton($this->caption, $this->htmlOptions) . "\n";
break;
case 'button':
echo CHtml::htmlButton($this->caption, $this->htmlOptions) . "\n";
break;
case 'link':
echo CHtml::link($this->caption, $this->url, $this->htmlOptions) . "\n";
break;
case 'radio':
if ($this->hasModel()) {
echo CHtml::activeRadioButton($this->model, $this->attribute, $this->htmlOptions);
echo CHtml::label($this->caption, CHtml::activeId($this->model, $this->attribute)) . "\n";
} else {
echo CHtml::radioButton($name, $this->value, $this->htmlOptions);
echo CHtml::label($this->caption, $id) . "\n";
}
break;
case 'checkbox':
if ($this->hasModel()) {
echo CHtml::activeCheckbox($this->model, $this->attribute, $this->htmlOptions);
echo CHtml::label($this->caption, CHtml::activeId($this->model, $this->attribute)) . "\n";
} else {
echo CHtml::checkbox($name, $this->value, $this->htmlOptions);
echo CHtml::label($this->caption, $id) . "\n";
}
break;
default:
throw new CException(Yii::t('zii', 'The button type "{type}" is not supported.', array('{type}' => $this->buttonType)));
}
$options = empty($this->options) ? '' : CJavaScript::encode($this->options);
if (isset($this->onclick)) {
if (strpos($this->onclick, 'js:') !== 0) {
$this->onclick = 'js:' . $this->onclick;
}
$click = CJavaScript::encode($this->onclick);
$cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').button({$options}).click({$click});");
} else {
$cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').button({$options});");
}
}
}
示例5: array
</div>
</div>
<div class="form-group">
<label class="<?php
echo $label_class;
?>
">Use Doctor Note</label>
<div class="col-md-6 col-xs-12">
<div class="form-control">
<?php
echo CHtml::activeRadioButton($model, 'doctor_note', array('value' => 0, 'style' => 'width:10px;'));
?>
<label style="width:100px;">No</label>
<?php
echo CHtml::activeRadioButton($model, 'doctor_note', array('value' => 1));
?>
<label>Yes</label>
</div>
</div>
</div>
<div class="form-group">
<label class="<?php
echo $label_class;
?>
">Doctor Note</label>
<div class="col-md-6 col-xs-12">
<?php
echo CHtml::image($model->getLetter(), 'letter', array('height' => '50px'));
?>
示例6: activeRadioButton
/**
* Generates 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.
*/
public static function activeRadioButton($model, $attribute, $htmlOptions = array())
{
$label = BsArray::popValue('label', $htmlOptions, false);
$labelOptions = BsArray::popValue('labelOptions', $htmlOptions, array());
$radioButton = parent::activeRadioButton($model, $attribute, $htmlOptions);
self::addCssClass('radio', $labelOptions);
return $label !== false ? self::tag('label', $labelOptions, $radioButton . ' ' . $label) : $radioButton;
}
示例7: activeRadioButton
/**
* Generates 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.
*/
public static function activeRadioButton($model, $attribute, $htmlOptions = array())
{
$label = TbArray::popValue('label', $htmlOptions, false);
$labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());
$input = parent::activeRadioButton($model, $attribute, $htmlOptions);
if (TbArray::popValue('useContainer', $htmlOptions, false)) {
return self::tag('div', array('class' => 'radio'), self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions));
} else {
return self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions);
}
}
示例8: foreach
?>
<table class="table table-condensed table-striped" id="addressTable" style="table-layout: fixed;">
<tbody>
<tr>
<th class="wordwrap" style="width: 10%;">Select</th>
<th class="wordwrap" style="width: 60%;">Address</th>
<th class="wordwrap" style="width: 30%;">Locality</th>
</tr>
<?php
//array( addrId => array( locality, addrText ) )
foreach ($addressArray as $key => $value) {
echo '<tr>';
echo '<td>';
echo CHtml::activeRadioButton($model, 'address', array('value' => $key, 'required' => true, 'data-locality_name' => $value[0], 'uncheckValue' => NULL));
echo '</td>';
echo '<td>';
echo $value[1];
echo '</td>';
echo '<td>';
echo $value[0];
echo '</td>';
echo '</tr>';
}
?>
</tbody>
</table>
<?php
echo $form->error($model, 'address', array(), false, false);
示例9: foreach
</div>
</div>
<div class="order_data">
<div class="left">
<div class="delivery rc5">
<h2>Способ доставки</h2>
<ul>
<?php
foreach ($deliveryMethods as $delivery) {
?>
<li>
<label class="radio">
<?php
echo CHtml::activeRadioButton($this->form, 'delivery_id', array('checked' => $this->form->delivery_id == $delivery->id, 'uncheckValue' => null, 'value' => $delivery->id, 'data-price' => Yii::app()->currency->convert($delivery->price), 'data-free-from' => Yii::app()->currency->convert($delivery->free_from), 'onClick' => 'recountOrderTotalPrice(this);', 'checked' => 'checked'));
?>
<span><?php
echo CHtml::encode($delivery->name);
?>
</span>
</label>
<p><?php
echo $delivery->description;
?>
</p>
</li>
<?php
}
?>
</div>
示例10: array
</div>
</div>
<div class="row" id="onlinepayment" style="display: none;">
<div class="col-xs-1">
<?php
echo CHtml::activeRadioButton($model, 'paymentMethod', array('value' => 2, 'required' => true, 'uncheckValue' => NULL, 'float' => 'left'));
?>
</div>
<div class="col-xs-10">
<p>Online payment PayU Money</p>
</div>
</div>
<div class="row" id="cod">
<div class="col-xs-1">
<?php
echo CHtml::activeRadioButton($model, 'paymentMethod', array('value' => 3, 'required' => true, 'uncheckValue' => NULL, 'float' => 'left'));
?>
</div>
<div class="col-xs-10">
<p>Cash on delivery</p>
</div>
</div>
<?php
echo $form->error($model, 'paymentMethod', array(), false, false);
//client validation made false due to radio button
?>
</div>
</div>
</div>
示例11: array
<label for="<?php
echo "ans_ext_{$ans->id_voting_answer}";
?>
" class="checkbox">
<?php
echo CHtml::activeCheckBox($ans, 'name[]', array('value' => $ans->id_voting_answer, 'id' => "ans_ext_{$ans->id_voting_answer}", 'uncheckValue' => null));
?>
<?php
} else {
?>
<label for="<?php
echo "ans_ext_{$ans->id_voting_answer}";
?>
" class="radio">
<?php
echo CHtml::activeRadioButton($ans, 'name', array('value' => $ans->id_voting_answer, 'id' => "ans_ext_{$ans->id_voting_answer}", 'uncheckValue' => null));
?>
<?php
}
?>
<?php
echo $ans->name;
?>
</label>
</li>
<?php
}
?>
</ul>
<div>
<?php
示例12: if
<div class="simple">
<?php echo CHtml::activeCheckBox($exportar,'usuarios'); ?>
Usuarios<br/>
</div>
<div class="simple">
<?php echo CHtml::activeCheckBox($exportar,'visitas'); ?>
Visitas<br/>
</div>
</br><h5>Elija el formato en el que desea exportar:</h5>
<!--Botones de radio para el tipo de archivo-->
<div class="simple">
<?php echo CHtml::activeRadioButton($exportar,'opcion',array('value'=>0)) . 'XML';
echo CHtml::activeRadioButton($exportar,'opcion',array('value'=>1)) . 'SQL'; ?>
</div></br>
<div class="action">
<?php echo CHtml::submitButton('Exportar'); ?>
</div>
<?php echo CHtml::endForm(); ?>
</div>
<?php if(Yii::app()->user->hasFlash('informacion')):?>
<div class="info">
<?php echo Yii::app()->user->getFlash('informacion'); ?>
</div></br>
<?php endif; ?>
示例13: array
?>
<?php
echo CHtml::label(Yii::t('core', 'unsignedZerofill'), 'Column_attribute_unsignedzerofill');
?>
--->
</td>
</tr>
<tr>
<td />
<td colspan="2">
<?php
echo $radio_options[3];
?>
<!---
<?php
echo CHtml::activeRadioButton($column, 'attribute', array('value' => 'on update current_timestamp', 'id' => CHtml::$idPrefix . 'Column_attribute_on_update_current_timestamp'));
?>
<?php
echo CHtml::label(Yii::t('core', 'onUpdateCurrentTimestamp'), 'Column_attribute_on_update_current_timestamp');
?>
--->
</td>
</tr>
<?php
if ($column->isNewRecord) {
?>
<tr id="<?php
echo CHtml::$idPrefix;
?>
settingSize">
<td>
示例14: array
<label class="einsatzzweck"><?php
echo CHtml::activeRadioButton($anlegenformmodel, "typ", array("value" => Veranstaltung::$TYP_PROGRAMM, "uncheckValue" => null));
?>
<div>Programmdiskussion</div></label>
<div class="einsatzzweck_erkl">
Folgendes ist hier voreingestellt <sup>1</sup>:
<ul>
<li>Es heißt "Kapitel" und "Änderungswünsche"</li>
<li>Die Zeilennummerierung ist fortlaufend durch alle Kapitel</li>
<li>Nummerierung der Änderungswünsche fortlaufend über die Kapitel hinweg.</li>
<li>Keine Freischaltung von Änderungswünschen nötig</li>
</ul>
</div>
<label class="einsatzzweck"><?php
echo CHtml::activeRadioButton($anlegenformmodel, "typ", array("value" => Veranstaltung::$TYP_PARTEITAG, "uncheckValue" => null));
?>
<div>Parteitag</div></label>
<div class="einsatzzweck_erkl">
Folgendes ist hier voreingestellt <sup>1</sup>:
<ul>
<li>Es heißt "Anträge" und "Änderungsanträge"</li>
<li>Neue Zeilennummerierung bei jedem Antrag</li>
<li>Nummerierung der Änderungsanträge pro Antrag separat</li>
<li>Freischaltung von Anträgen und Änderungsanträgen nötig</li>
</ul>
</div>
<div class="weiter">
<button class="btn btn-primary" id="weiter-1"><span class='icon-chevron-right'></span> Weiter</button>
</div>
示例15: radioButton
/**
* Renders a radio button for a model attribute.
* This method is a wrapper of {@link CHtml::activeRadioButton}.
* Please check {@link CHtml::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 CHtml::activeRadioButton($model, $attribute, $htmlOptions);
}