本文整理汇总了PHP中TbHtml::fileField方法的典型用法代码示例。如果您正苦于以下问题:PHP TbHtml::fileField方法的具体用法?PHP TbHtml::fileField怎么用?PHP TbHtml::fileField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TbHtml
的用法示例。
在下文中一共展示了TbHtml::fileField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Runs the widget.
*/
public function run()
{
list($name, $id) = $this->resolveNameID();
$this->resolveId($id);
if ($this->hasModel()) {
$input = TbHtml::activeFileField($this->model, $this->attribute, $this->htmlOptions);
} else {
$input = TbHtml::fileField($name, $this->value, $this->htmlOptions);
}
echo TbHtml::tag('span', $this->buttonOptions, $this->label . ' ' . $input);
if ($this->assetPath !== false) {
$this->publishAssets($this->assetPath);
$this->registerCssFile('css/jquery.fileupload-ui.css');
if ($this->registerJs) {
$this->getClientScript()->registerCoreScript('jquery');
$this->registerScriptFile('js/vendor/jquery.ui.widget.js', CClientScript::POS_END);
$this->registerScriptFile('js/jquery.iframe-transport.js', CClientScript::POS_END);
$this->registerScriptFile('js/jquery.fileupload.js', CClientScript::POS_END);
}
}
if ($this->bindPlugin) {
TbArray::defaultValue('dataType', 'json', $this->pluginOptions);
$options = !empty($this->pluginOptions) ? CJavaScript::encode($this->pluginOptions) : '';
$script = <<<EOD
jQuery('#{$id}')
.fileupload({$options})
.prop('disabled', !jQuery.support.fileInput)
.parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
EOD;
$this->getClientScript()->registerScript(__CLASS__ . '#' . $id, $script);
}
}
示例2: testFileField
public function testFileField()
{
$I = $this->codeGuy;
$html = TbHtml::fileField('file', '', array('class' => 'input'));
$input = $I->createNode($html, 'input[type=file]');
$I->seeNodeAttributes($input, array('class' => 'input', 'id' => 'file', 'name' => 'file', 'value' => ''));
}
示例3: array
<div class='box3 text-right'>
<div class="input-append">
<?php
//echo TbHtml::label('Rango de fechas:','archivo', array('style'=>'display:inline-table;'));
$this->widget('yiiwheels.widgets.daterangepicker.WhDateRangePicker', array('name' => 'fechas', 'pluginOptions' => array('format' => 'YYYY-MM-DD'), 'htmlOptions' => array('id' => 'fechas', 'placeholder' => 'Seleccione el rango de fechas')));
?>
<span class="add-on"><icon class="icon-calendar"></icon></span>
</div>
<br />
<br />
<?php
//echo TbHtml::label('Archivo txt:','archivo', array('style'=>'display:inline-table;'));
?>
<?php
echo TbHtml::fileField('archivo');
?>
</div>
<br />
<?php
echo TbHtml::button(' Conciliar', array('id' => 'btn-subir', 'class' => 'btn btn-primary fa fa-compress'));
$this->endWidget();
?>
</div>
<div id='pbar' style="display:none">
<?php
echo TbHtml::animatedProgressBar(100);
?>
</div>
示例4: array
?>
</div>
<div class='span4 white-box box'>
<h3><?php
echo TbHtml::i('', array('class' => 'fa fa-picture-o'));
?>
Imagen para PV</h3>
<?php
echo TbHtml::imagePolaroid(strlen($model->EventoImaMin) > 3 ? "../imagesbd/" . $model->EventoImaMin : 'holder.js/130x130', '', array('id' => 'img-imamin'));
?>
<br /><br />
<?php
echo TbHtml::fileField('imamin', '', array('span' => 2, 'maxlength' => 200, 'class' => 'hidden'));
?>
<?php
echo $form->textField($model, 'EventoImaMin', array('append' => TbHtml::button('Seleccionar imagen', array('class' => 'btn btn-success', 'id' => 'btn-subir-imamin')), 'placeholder' => 'Nombre de la imagen miniatura'));
?>
</div>
<?php
if ($model->scenario == 'update' and !empty($funciones)) {
?>
<style>
.modal-body {
max-height: 100%;
}
.modal-footer{
padding: 2px 15px;