本文整理汇总了PHP中Chtml::TextField方法的典型用法代码示例。如果您正苦于以下问题:PHP Chtml::TextField方法的具体用法?PHP Chtml::TextField怎么用?PHP Chtml::TextField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chtml
的用法示例。
在下文中一共展示了Chtml::TextField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: array
<span class="chatboxuser"><?php
echo $user;
?>
</span>
</div>
<div class="chatboxmain">
<div class="chatboxmess">
</div>
<div class="chatboxinput">
<?php
echo Chtml::hiddenField('username', $user);
?>
<?php
echo Chtml::TextField('chatboxmessage', '', array('class' => "chatboxmessage", ' size' => '20', 'maxlength' => '100'));
?>
<a href="#" class="chatboxsend">Send</a>
</div>
</div>
</div>
<div class="chatboxbtn <?php
echo $options['float'];
?>
" title="Open <?php
echo $options['title'];
?>
">
</div>