本文整理汇总了PHP中CHtml::activeLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP CHtml::activeLabel方法的具体用法?PHP CHtml::activeLabel怎么用?PHP CHtml::activeLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHtml
的用法示例。
在下文中一共展示了CHtml::activeLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rowStart
private static function rowStart(CModel $model, $ngFieldName)
{
echo '<div class="control-group">';
if ($ngFieldName != "") {
CHtml::activeLabel($ngFieldName, $model);
}
echo '<div class="controls">';
}
示例2: checkBox
/**
* Renders a checkbox.
* @return string the rendered content
*/
protected function checkBox()
{
$attribute = $this->attribute;
echo '<label class="checkbox" for="' . $this->getAttributeId($attribute) . '">';
echo $this->form->checkBox($this->model, $this->attribute, $this->htmlOptions) . PHP_EOL;
$attr = CHtml::resolveName($this->model, $attribute);
// strip off square brackets if any
echo CHtml::activeLabel($this->model, $attribute);
echo $this->getError() . $this->getHint();
echo '</label>';
}
示例3: renderLabel
/**
* Renders the label for this input.
* The default implementation returns the result of {@link CHtml activeLabelEx}.
* @return string the rendering result
*/
public function renderLabel()
{
$options = array('label' => $this->getLabel(), 'required' => $this->getRequired(), 'class' => 'control-label');
if ($this->parent->layout == 'horizontal') {
$options['class'] .= ' col-sm-3';
}
if (!empty($this->attributes['id'])) {
$options['for'] = $this->attributes['id'];
}
return CHtml::activeLabel($this->getParent()->getModel(), $this->name, $options);
}
示例4: renderLabel
public function renderLabel()
{
$options = array('label' => $this->getLabel(), 'class' => 'control-label');
if ($this->getRequired()) {
$options['class'] .= ' required';
}
//Agrego la clase required al label
if (!empty($this->attributes['id'])) {
$options['for'] = $this->attributes['id'];
}
return CHtml::activeLabel($this->getParent()->getModel(), $this->name, $options);
}
示例5: renderInputs
public function renderInputs()
{
$this->attributes = array('oauthAccessToken' => null, 'oauthAccessTokenSecret' => null, 'consumerKey' => null, 'consumerSecret' => null);
echo CHtml::activeLabel($this, 'consumerKey');
$this->renderInput('consumerKey');
echo CHtml::activeLabel($this, 'consumerSecret');
$this->renderInput('consumerSecret');
echo CHtml::activeLabel($this, 'oauthAccessToken');
$this->renderInput('oauthAccessToken');
echo CHtml::activeLabel($this, 'oauthAccessTokenSecret');
$this->renderInput('oauthAccessTokenSecret');
echo CHtml::errorSummary($this);
}
示例6: run
public function run()
{
$attr = $this->attribute;
if (!$this->model->{$attr} instanceof JSONEmbeddedModel) {
$this->model->instantiateField($attr);
}
echo '<br />';
echo '<br />';
echo CHtml::activeLabel($this->model, $attr);
echo '<hr />';
$this->model->{$attr}->renderInputs();
echo '<br />';
echo '<br />';
}
示例7: renderInputs
public function renderInputs()
{
$this->password = null;
echo CHtml::activeLabel($this, 'senderName');
$this->renderInput('senderName');
echo CHtml::activeLabel($this, 'email');
$this->renderInput('email');
echo CHtml::activeLabel($this, 'user');
$this->renderInput('user');
echo CHtml::activeLabel($this, 'password');
$this->renderInput('password');
echo '<br/>';
echo CHtml::errorSummary($this);
}
示例8: label
/**
* Renders an HTML label for a model attribute.
* This method is a wrapper of {@link CHtml::activeLabel}.
* Please check {@link CHtml::activeLabel} 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 label tag
*/
public function label($model, $attribute, $htmlOptions = array())
{
return CHtml::activeLabel($model, $attribute, $htmlOptions);
}
示例9: array
<?php
echo CHtml::activeTextField($form, 'sms_message', array('style' => 'width: 130px;'));
?>
<?php
echo CHtml::error($form, 'sms_message');
?>
</td>
</tr>
<tr>
<th><?php
echo CHtml::activeLabel($form, 'lat');
?>
:</th>
<th><?php
echo CHtml::activeLabel($form, 'lng');
?>
:</th>
</tr>
<tr>
<td><?php
echo CHtml::activeTextField($form, 'lat', array('style' => 'width: 130px;'));
echo CHtml::error($form, 'lat');
?>
</td>
<td><?php
echo CHtml::activeTextField($form, 'lng', array('style' => 'width: 130px;'));
echo CHtml::error($form, 'lng');
?>
</td>
</tr>
示例10:
<?php
echo CHtml::errorSummary($model);
?>
<fieldset class="top">
<div class="row clearfix">
<?php
echo CHtml::activeLabel($model, 'course_code');
?>
<?php
echo CHtml::activeTextField($model, 'course_code');
?>
</div>
<div class="row clearfix">
<?php
echo CHtml::activeLabel($model, 'user_id');
?>
<?php
echo CHtml::activeTextField($model, 'user_id');
?>
</div>
</fieldset>
<fieldset class="buttons bottom">
<?php
echo CHtml::submitButton('Assign');
?>
</fieldset>
<?php
echo CHtml::endForm();
?>
</div>
示例11: array
<?php
echo CHtml::endForm();
?>
<h1>Import settings</h1>
<?php
echo CHtml::beginForm($this->createUrl('superadmin/exportadminssettings'), 'post', array('id' => 'formimportadminssettings', 'enctype' => 'multipart/form-data'));
?>
<?php
echo CHtml::hiddenField('type', 'import');
?>
<table class="">
<tr>
<th><?php
echo CHtml::activeLabel($importAdminsSettings, 'imported_file');
?>
:</th>
<td><?php
echo CHtml::activeFileField($importAdminsSettings, 'imported_file');
?>
</td>
</tr>
</table>
<br/><br/>
<?php
echo CHtml::submitButton('Import');
?>
<?php
echo CHtml::endForm();
?>
示例12: array_slice
<?php
echo CHtml::activeDropDownList($user, 'role', array_slice(Yii::app()->params['user_role'], 0), array('style' => 'width: 270px;'));
?>
</td>
</tr>
<tr>
<th><?php
echo CHtml::activeLabel($user, 'access');
?>
</th>
<td>
<div>
<input type="checkbox" id="check_all_features" onclick="//$('div.checkBoxList input').attr('checked', ($(this).attr('checked') == 'checked' ? true : false));"/>
<?php
echo CHtml::activeLabel($user, 'allAccess');
?>
</div>
<?php
if (is_array($actions)) {
foreach ($actions as $value) {
?>
<div class="checkBoxList">
<input type="checkbox" name="access[]" value="<?php
echo $value['id'];
?>
" <?php
echo in_array($value['id'], $access) ? 'checked' : '';
?>
/>
<?php
示例13: array
?>
<div class="alert alert-warning span12" id="msjError" style="">Atención: Hay un examen en esa fecha de otra materia
del plan.
</div>
<p class="note">
Campos obligatorios <span class="required">*</span>
</p>
<?php
echo $form->errorSummary($model, '', null, array('class' => 'alert alert-error'));
?>
<div class="control-group">
<div class="span10">
<div class="row">
<?php
if (Yii::app()->user->isAdmin()) {
echo CHtml::activeLabel($model, $model->materia->nombreMateria, array('class' => 'lead'));
echo $form->hiddenField($model, 'materia_id');
}
?>
</div>
<div id="left-content">
<div class="row">
<?php
echo $form->labelEx($model, 'fechaExamen');
?>
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'fechaExamen', 'language' => 'es', 'themeUrl' => Yii::app()->baseUrl . '/css/jquery-ui-themes/themes', 'theme' => 'bootstrap', 'flat' => true, 'options' => array('onSelect' => 'js: test', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeYear' => true, 'changeMonth' => true, 'showButtonPanel' => true, 'yearRange' => '2013:2099'), 'htmlOptions' => array('size' => '7', 'readonly' => "readonly", 'maxlength' => '10')));
?>
<?php
echo $form->error($model, 'fechaExamen');
?>
示例14: array
<div class="large-4 column">
<?php
echo CHtml::activeLabel($model, 'username', array('label' => 'Username:', 'class' => 'align'));
?>
</div>
<div class="large-8 column">
<?php
echo $form->textField($model, 'username', array('autocomplete' => Yii::app()->params['html_autocomplete'], 'placeholder' => 'Enter username...', 'class' => 'large'));
?>
</div>
</div>
<div class="row field-row">
<div class="large-4 column">
<?php
echo CHtml::activeLabel($model, 'password', array('label' => 'Password:', 'class' => 'align'));
?>
</div>
<div class="large-8 column">
<?php
echo $form->passwordField($model, 'password', array('autocomplete' => 'off', 'placeholder' => 'Enter password...', 'class' => 'large'));
?>
</div>
</div>
<div class="row field-row text-right">
<div class="large-12 column">
<img class="loader" src="<?php
echo Yii::app()->assetManager->createUrl('img/ajax-loader.gif');
?>
示例15: array
</tr>
<tr>
<td> <?php
echo CHtml::activeTextField($model, 'subject');
?>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><?php
echo CHtml::activeLabel($model, 'body');
?>
</td>
</tr>
<tr>
<td COLSPAN=2><?php
echo CHtml::activeTextArea($model, 'body', array('rows' => 5, 'cols' => 35));
?>
</td>
</tr>
<tr>
<td> </td>
<td> </td>