本文整理汇总了PHP中Chtml::activeTextField方法的典型用法代码示例。如果您正苦于以下问题:PHP Chtml::activeTextField方法的具体用法?PHP Chtml::activeTextField怎么用?PHP Chtml::activeTextField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chtml
的用法示例。
在下文中一共展示了Chtml::activeTextField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createMarkup
/**
* Creates markup required for the current mode.
*/
public function createMarkup() {
list($name,$id)=$this->resolveNameID();
$this->htmlOptions["name"]= $name;
$this->htmlOptions["id"]= $id;
if(!$this->hasModel()) {
$this->htmlOptions["value"]= $this->getValue();
} else {
$this->htmlOptions["value"]= $this->model->{$this->attribute} != "" ? $this->model->{$this->attribute} :
$this->getValue();
}
$this->htmlOptions["style"]= "width:".($this->getWidth()-13)."px";
$this->htmlOptions["class"]= "textfield";
$this->htmlOptions["readonly"]= "true";
$field = $this->hasModel() ?
Chtml::activeTextField($this->model,$this->attribute,$this->htmlOptions) :
Chtml::TextField($this->name,$this->getValue(),$this->htmlOptions);
?>
<script>
var <?php echo $id."_list"?> = new Array();
<?php if (count($this->_list) > 0) { ?>
<?php foreach ($this->_list as $i=>$v) { ?>
<?php echo $id."_list"?>.push('<?php echo addslashes($v)?>');
<?php }
}?>
</script>
<div class='spinner' style="height:<?php echo $this->getHeight()?>px">
<table cellspacing=0 cellpadding=0 align="left">
<tr>
<td rowspan='2'>
<?php echo $field ?>
</td>
<td class="button_up" style="background-color:<?php echo $this->bgColor?>"
onmousedown="javascript:setMouseDown('up','<?php echo $id?>','<?php echo $this->_type?>',
<?php echo $id."_list"?>
,<?php echo "0"?>,<?php echo "0"?>,
<?php echo "0"?>,<?php echo $this->getDelay()?>,
'<?php echo $this->getAcceleration()?>');"
onmouseup="setMouseUp();" onmouseout="setMouseUp();">
</td>
</tr>
<tr>
<td class="button_down" style="background-color:<?php echo $this->bgColor?>"
onmousedown="javascript:setMouseDown('down','<?php echo $id?>','<?php echo $this->_type?>',
<?php echo $id."_list"?>,
<?php echo "0"?>,<?php echo "0"?>,
<?php echo "0"?>,<?php echo $this->getDelay()?>,
'<?php echo $this->getAcceleration()?>')"
onmouseup="setMouseUp();" onmouseout="setMouseUp();">
</td>
</tr>
</table>
<span class="text"><?php echo $this->text?></span>
</div>
<?
}
示例2:
echo Chtml::activeLabel($model, 'password');
echo Chtml::activePasswordField($model, 'password');
?>
</div>
<div class="row">
<?php
echo Chtml::activeLabel($model, 'email');
echo Chtml::activeTextField($model, 'email');
?>
</div>
<div class="row">
<?php
echo Chtml::activeLabel($model, 'telephone');
echo Chtml::activeTextField($model, 'telephone');
?>
</div>
<div class="row submit">
<?php
echo CHtml::submitButton('register');
?>
</div>
<?php
echo CHtml::endForm();
?>
</div><!-- form -->
</div>
示例3:
<div class="form">
<?php
echo CHtml::beginForm();
?>
<?php
echo CHtml::errorSummary($model);
?>
<div class="row">
<?php
echo Chtml::activeLabel($model, 'login');
echo Chtml::activeTextField($model, 'login');
?>
</div>
<div class="row">
<?php
echo Chtml::activeLabel($model, 'password');
echo Chtml::activePasswordField($model, 'password');
?>
</div>
<div class="row submit">
<?php
echo CHtml::submitButton('Войти');
?>
</div>
<?php
示例4:
</div>
<?php
if (extension_loaded('gd')) {
?>
<div class="row">
<?php
echo Chtml::activeLabelEx($model, 'verifyCode');
?>
<div>
<?php
$this->widget('CCaptcha');
?>
<br>
<?php
echo Chtml::activeTextField($model, 'verifyCode');
?>
</div>
<div class="hint">
Ketik tulisan pada gambar,<br>Tulisan tidak case sensitive.
</div>
</div>
<?php
}
?>
<div class="row buttons">
<?php
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
</div>