当前位置: 首页>>代码示例>>PHP>>正文


PHP FileInput::className方法代码示例

本文整理汇总了PHP中kartik\file\FileInput::className方法的典型用法代码示例。如果您正苦于以下问题:PHP FileInput::className方法的具体用法?PHP FileInput::className怎么用?PHP FileInput::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kartik\file\FileInput的用法示例。


在下文中一共展示了FileInput::className方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

echo $form->field($model, 'name');
?>
        <?php 
echo $form->field($model, 'category_id')->widget(Select2::className(), ['data' => Category::getKeyValuePairs(), 'options' => ['placeholder' => '请选择分类'], 'pluginOptions' => ['allowClear' => true]]);
?>
        <?php 
if ($model->isNewRecord) {
    ?>
        <?php 
    echo $form->field($model, 'image')->widget(FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['showUpload' => false, 'browseLabel' => '选择图片', 'removeLabel' => '删除']]);
    ?>
        <?php 
} else {
    ?>
        <?php 
    echo $form->field($model, 'image')->widget(FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['showUpload' => false, 'browseLabel' => '选择图片', 'removeLabel' => '删除', 'initialPreview' => Html::img(Url::toCover($model->cover), ['class' => 'file-preview-image'])]]);
    ?>
        <?php 
}
?>
        <?php 
echo $form->field($model, 'description')->textarea();
?>
        <?php 
echo $form->field($model, 'price_original');
?>
        <?php 
echo $form->field($model, 'price');
?>
        <?php 
echo $form->field($model, 'cost');
开发者ID:daixianceng,项目名称:xiaoego.com,代码行数:31,代码来源:form.php

示例2:

?>
    
    <?php 
echo $form->field($model, 'img7')->hiddenInput([])->label(false);
?>
    
    <?php 
echo $form->field($model, 'image8')->widget(FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => [!$model->isNewRecord ? !empty($model->image8) ? Html::img(\Yii::$app->jurnalrumah->lihatImageDetail($model->image8, "", $kategori = "artikel")) : NULL : null], 'allowedFileExtensions' => ['jpg', 'png', 'jpeg'], 'showUpload' => false], 'pluginEvents' => ['fileclear' => "function() {\n                \$('#" . Html::getInputId($model, 'img8') . "').val(1);\n            }", 'filebatchselected' => "function(){\n                \$('#" . Html::getInputId($model, 'img8') . "').val(0);\n            }"]]);
?>
    
    <?php 
echo $form->field($model, 'img8')->hiddenInput([])->label(false);
?>
    
    <?php 
echo $form->field($model, 'image9')->widget(FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => [!$model->isNewRecord ? !empty($model->image9) ? Html::img(\Yii::$app->jurnalrumah->lihatImageDetail($model->image9, "", $kategori = "artikel")) : NULL : null], 'allowedFileExtensions' => ['jpg', 'png', 'jpeg'], 'showUpload' => false], 'pluginEvents' => ['fileclear' => "function() {\n                \$('#" . Html::getInputId($model, 'img9') . "').val(1);\n            }", 'filebatchselected' => "function(){\n                \$('#" . Html::getInputId($model, 'img9') . "').val(0);\n            }"]]);
?>
    
    <?php 
echo $form->field($model, 'img9')->hiddenInput([])->label(false);
?>
    
    <?php 
echo $form->field($model, 'judul')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'summary')->textInput(['maxlength' => true]);
?>

    <?php 
开发者ID:iwansusanto,项目名称:jurnalrumah,代码行数:31,代码来源:_form.php

示例3: ceil

                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <a href="http://gravatar.com" target="_blank" class="pull-right"><?php 
echo Yii::t('podium/view', 'What is Gravatar?');
?>
</a>
                            <?php 
echo $form->field($model, 'gravatar')->checkbox()->label('<strong>' . Yii::t('podium/view', 'Use Gravatar image as avatar') . '</strong>');
?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <?php 
echo $form->field($model, 'image')->label(Yii::t('podium/view', 'Or upload your own avatar'))->widget(FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'jpeg', 'gif', 'png']]])->hint(Yii::t('podium/view', 'Square avatars look best.') . '<br>' . Yii::t('podium/view', 'Maximum size is {size}, {width}x{height} pixels; png, jpg and gif images only.', ['size' => ceil(Meta::MAX_SIZE / 1024) . 'kB', 'width' => Meta::MAX_WIDTH, 'height' => Meta::MAX_HEIGHT]));
?>
                        </div>
                    </div>
                </div>
                <div class="panel-footer">
                    <div class="row">
                        <div class="col-sm-12">
                            <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-ok-sign"></span> ' . Yii::t('podium/view', 'Save changes'), ['class' => 'btn btn-block btn-primary', 'name' => 'save-button']);
?>
                        </div>
                    </div>
                </div>
            <?php 
ActiveForm::end();
开发者ID:aekkapun,项目名称:yii2-podium,代码行数:31,代码来源:forum.php

示例4:

echo $form->errorSummary($model);
?>
        <?php 
$this->beginBlock('main');
?>
        <p>
            <?php 
echo $form->field($model, 'tech_id')->dropDownList(\yii\helpers\ArrayHelper::map(\common\models\Tech::find()->contact()->all(), 'contact_id', 'contact.name'), ['prompt' => '']);
?>

            <?php 
echo $form->field($model, 'amount')->textInput(['maxlength' => true]);
?>

            <?php 
echo $form->field($model, 'receiptImg')->widget(\kartik\file\FileInput::className(), ['options' => ['accept' => 'image/*,text/*,application/pdf'], 'pluginOptions' => ['browseClass' => 'btn btn-info btn-xs', 'showCaption' => false, 'showRemove' => false, 'showUpload' => false, 'initialPreview' => [$model->isNewRecord ? null : Yii::$app->formatter->asFile($model, ['receipt', 'id' => $model->id])]]]);
?>

        </p>
        <?php 
$this->endBlock();
?>


        <?php 
echo TabsX::widget(['encodeLabels' => false, 'items' => [['label' => 'Reimbursement', 'content' => $this->blocks['main']]]]);
?>
        <hr/>

        <div class="btn-group pull-right">
            <?php 
开发者ID:jslight,项目名称:helpdesk,代码行数:31,代码来源:_form.php

示例5:

                <?php 
echo $form->field($model, 'city')->textInput();
?>

                <?php 
echo $form->field($model, 'school')->textInput();
?>

                <?php 
echo $form->field($model, 'class')->textInput();
?>

                <?php 
echo $form->field($model, 'text')->textarea();
?>

                <?php 
echo $form->field($model, 'images[]')->widget(FileInput::className(), ['options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['showUpload' => false, 'showCaption' => false, 'showRemove' => false, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => 'Нажмите, чтобы выбрать фото']]);
?>

                <?php 
echo Html::submitButton('Отправить', ['class' => 'btn btn-primary']);
?>

                <?php 
ActiveForm::end();
?>
            </div>
    </div>
</div>
开发者ID:CyanoFresh,项目名称:PhotoSchool,代码行数:30,代码来源:index.php

示例6:

<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\file\FileInput;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\models\ImportProducts */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="import-products-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'filename')->widget(FileInput::className(), ['pluginOptions' => ['showPreview' => false, 'showCaption' => false, 'showUpload' => true, 'browseLabel' => 'Открыть', 'allowedFileExtension' => ['xml']]]);
?>

    <?php 
ActiveForm::end();
?>

</div>
开发者ID:kvaxminsk,项目名称:belpharma2,代码行数:25,代码来源:_form.php

示例7: isset

?>

    <hr>
    <?php 
echo $form->field($review, 'title')->textInput(['maxlength' => true]);
?>
    <?php 
echo $form->field($review, 'text')->textarea(['rows' => 5]);
?>

    <?php 
echo $form->field($review, 'rating')->widget(StarRating::classname(), ['pluginOptions' => ['stars' => 5, 'min' => 0, 'max' => 5, 'step' => 1, 'showCaption' => false, 'showClear' => false, 'size' => 'xs']]);
?>

    <?php 
echo $form->field($review, 'image')->widget(FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['language' => 'ru', 'initialPreview' => isset($imagePreview) ? $imagePreview['initialPreview'] : [], 'initialPreviewConfig' => isset($imagePreview) ? $imagePreview['initialPreviewConfig'] : [], 'showUpload' => false, 'showRemove' => false, 'showCaption' => true]]);
?>

    <?php 
echo $form->field($review, 'ids_city')->widget(Select2::className(), ['data' => $cities, 'size' => Select2::MEDIUM, 'language' => 'ru', 'options' => ['multiple' => true], 'pluginOptions' => ['allowClear' => true], 'addon' => ['append' => ['content' => Html::button('Добавить', ['class' => 'btn btn-success toggle-add-city-form']), 'asButton' => true]], 'id' => 'ids-city']);
?>

    <hr>
    <div class="form-group">
        <?php 
echo Html::submitButton($review->isNewRecord ? 'Создать' : 'Редактировать', ['class' => $review->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        <?php 
echo Html::button('Закрыть', ['class' => 'btn btn-default', 'data-dismiss' => 'modal']);
?>
    </div>
开发者ID:vampir2236,项目名称:cities.ru,代码行数:31,代码来源:_form.php

示例8: array_merge

    <? //= $form->field($model, 'verification_code')->textInput(['maxlength' => true]) ?>


    <div class="row">
        <div class="col-xs-6 form-group">
            <?php 
echo $form->field($model, 'user_type')->listBox([\common\constants\UserType::MODERATOR => 'Модератор', \common\constants\UserType::ADMINISTRATOR => 'Администратор'], ['size' => 2]);
?>
        </div>
        <div class="col-xs-6 form-group">
            <?php 
$config = $model->image ? ['initialPreview' => [Html::img("/image/" . $model->image, ['class' => 'file-preview-image'])], 'initialCaption' => $model->image, 'overwriteInitial' => true] : [];
?>
            <?php 
echo $form->field($model, 'image')->widget(\kartik\file\FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => array_merge(['showRemove' => false, 'showUpload' => false, 'browseLabel' => 'Выбрать изображение'], $config)]);
?>
        </div>
    </div>
    <? //= $form->field($model, 'status')->textInput(['maxlength' => true]) ?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Изменить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>
开发者ID:apuc,项目名称:NDFL,代码行数:29,代码来源:_form.php

示例9:

echo Html::encode($this->title);
?>
</h1>

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'name');
?>
    <?php 
echo $form->field($model, 'date')->widget(DatePicker::className(), ['pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
    <?php 
echo $form->field($model, 'author_id')->dropDownList($authors, ['prompt' => 'Выбирите автора']);
?>
    <?php 
echo $form->field($model, 'preview')->widget(FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['showUpload' => false]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton('Submit', ['class' => 'btn btn-primary']);
?>
    </div>
    <?php 
ActiveForm::end();
?>
</div>
开发者ID:kocapb,项目名称:library,代码行数:30,代码来源:create.php

示例10:

<?php

use yii\bootstrap\ActiveForm;
use kartik\file\FileInput;
use yii\helpers\Url;
use yii\helpers\Html;
$form = ActiveForm::begin();
?>

<div class="row">

    <?

    echo $form->field($model, 'general_image')->widget(FileInput::className(), [
        'options' => [
            'accept' => 'image/*',
        ],
        'pluginOptions' => [
            'uploadUrl' => Url::to(['file-upload-general']),
            'uploadExtraData' => [
                'advert_id' => $model->idadvert,
            ],
            'allowedFileExtensions' => ['jpg', 'png', 'gif', 'jpeg'],
            'maxFileSize' => 100,
            'initialPreview' => $image,
            'showUpload' => true,
            'showRemove' => false,
            'dropZoneEnabled' => false,
        ]
    ]);
开发者ID:scorp7mix,项目名称:yii,代码行数:30,代码来源:step2.php

示例11:

use common\helpers\Url;
$preview = [];
foreach ($model->images as $img) {
    $preview[] = Html::img(Url::toGoods($img->name), ['class' => 'file-preview-image']);
}
$this->title = '更新商品图片';
?>
<div class="row">
    <div class="col-lg-6">
    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
        <?php 
echo $form->field($model, 'name')->textInput(['disabled' => true]);
?>
        <?php 
echo $form->field($model, 'photos[]')->widget(FileInput::className(), ['options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['showUpload' => false, 'browseLabel' => '选择照片', 'removeLabel' => '删除', 'initialPreview' => $preview]]);
?>
        <div class="form-group">
            <?php 
echo Html::submitButton('<i class="fa fa-floppy-o"></i> 保存', ['class' => 'btn btn-primary']);
?>
            <?php 
echo Html::a('返回商品详情', ['/goods/update', 'id' => $model->id], ['class' => 'text-warning']);
?>
        </div>
    <?php 
ActiveForm::end();
?>
    </div>
</div>
开发者ID:daixianceng,项目名称:xiaoego.com,代码行数:31,代码来源:form-img.php

示例12: array_merge

    <div class="row">
        <div class="col-md-4">
            <?php 
echo $form->field($model, 'author_id')->dropDownList($authorsAssoc);
?>
            <?php 
echo $form->field($model, 'name')->textarea(['rows' => 4]);
?>
        </div>
        <div class="col-md-8">
            <div class="col-md-8">
                <?php 
$pluginOptions = $model->isNewRecord ? ['showCaption' => false, 'showRemove' => false, 'showUpload' => false, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-picture"></i> ', 'browseLabel' => Yii::t('app', 'Add Cover')] : array_merge(['showCaption' => false, 'showRemove' => false, 'showUpload' => false, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-picture"></i> ', 'browseLabel' => Yii::t('app', 'Add Cover')], ['initialPreview' => [Html::img($model->getCoverWebPath(), ['class' => 'file-preview-image', 'alt' => $model->preview_path, 'title' => $model->preview_path])], 'initialCaption' => $model->preview_path]);
?>
                <?php 
echo $form->field($cover, 'cover')->widget(\kartik\file\FileInput::className(), ['pluginOptions' => $pluginOptions, 'options' => ['accept' => 'image/*', 'multiple' => false]]);
?>
            </div>
            <div class="col-md-4">
                <?php 
echo Html::label($model->getAttributeLabel('release_date'));
?>
                <?php 
echo Html::tag('div', null, ['data-type' => 'release_date_ui', 'data-date-ui' => date('Y-m-d', $model->isNewRecord ? time() : $model->release_date)]);
?>
                <?php 
echo Html::tag('input', null, ['data-type' => 'release_date', 'type' => 'hidden', 'name' => 'Model[release_date]', 'value' => $model->isNewRecord ? time() : ($model->release_date ? $model->release_date : strtotime($model->release_date)), 'data-date-ui' => date('Y-m-d', $model->isNewRecord ? time() : $model->release_date)]);
?>
            </div>
        </div>
    </div>
开发者ID:n82786603,项目名称:something,代码行数:31,代码来源:_form.php

示例13:

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\file\FileInput;
/* @var $this yii\web\View */
/* @var $model common\models\Carousel */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="carousel-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'file')->widget(FileInput::className(), ['pluginOptions' => ['showCaption' => false, 'showUpload' => false, 'showRemove' => false, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => 'Select Photo', 'allowedFileExtensions' => ['jpg', 'gif', 'png']], 'options' => ['accept' => 'image/*']]);
?>


    <?php 
echo $form->field($model, 'image_link')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'carousel_order')->textInput();
?>

    <?php 
echo $form->field($model, 'is_target_self')->checkBox(['label' => 'Self']);
?>
开发者ID:noorafree,项目名称:makmakan,代码行数:30,代码来源:_form.php

示例14:

        <div class="col-md-6">
            <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>

            <?php 
echo $form->field($model, 'published')->dropDownList([1 => 'yes', 2 => 'no']);
?>
            <?php 
echo $form->field($model, 'document_category_id')->dropDownList($documentCategory, ['prompt' => '--Select--']);
?>
        </div>
        <div class="col-md-6">
            <p class="bg-info"></p>
            <?php 
echo $form->field($model, 'file_name')->widget(FileInput::className(), ['pluginOptions' => ['previewFileType' => 'file_name', 'showUpload' => false, 'browseLabel' => 'Browse &hellip;']]);
?>

            <?php 
if (isset($model->file_name) && !empty($model->file_name)) {
    ?>

                <div class="thumbnail">
                    <img alt="200x200" class="img-thumbnail" style="width: 300px;"
                         src="<?php 
    echo $model->getThumb();
    ?>
">


                </div>
开发者ID:zivoradantonijevic,项目名称:documents,代码行数:31,代码来源:_form.php

示例15:

?>

    <?php 
echo $form->field($model, 'tags')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList($model->getArticlesStatusArray(), ['prompt' => Module::t('app', 'ARTICLE_STATUS_LIST')]);
?>

    <p class="alert alert-info">
        <?php 
echo Module::t('app', 'ARTICLE_ANONS_IMAGE_INFO');
?>
    </p>
    <?php 
echo $form->field($model, 'anons_img')->widget(FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'png']]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Module::t('app', 'BUTTON_CREATE') : Module::t('app', 'BUTTON_UPDATE'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
开发者ID:knyazushka,项目名称:z34lot.new,代码行数:30,代码来源:_form.php


注:本文中的kartik\file\FileInput::className方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。