コード例 #1
0
ファイル: _form.php プロジェクト: simple-yii2/slider
?>

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

	<?php 
echo $form->field($model, 'description')->textarea(['rows' => 3]);
?>

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

	<?php 
echo $form->field($model, 'file')->widget(UploadImage::className(), ['id' => 'slider-image', 'thumbAttribute' => 'thumb', 'thumbWidth' => 1200, 'thumbHeight' => $thumbHeight, 'width' => 282, 'height' => $height, 'maxImageWidth' => 1200, 'maxImageHeight' => 1200]);
?>

	<div class="form-group">
		<div class="col-sm-offset-3 col-sm-6">
			<?php 
echo Html::submitButton(Yii::t('slider', 'Save'), ['class' => 'btn btn-primary']);
?>
			<?php 
echo Html::a(Yii::t('slider', 'Cancel'), ['index', 'slider_id' => $slider->id], ['class' => 'btn btn-default']);
?>
		</div>
	</div>

<?php 
ActiveForm::end();
コード例 #2
0
ファイル: _form.php プロジェクト: simple-yii2/gallery
use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use gallery\backend\assets\GalleryFormAsset;
use uploadimage\widgets\UploadImage;
use uploadimage\widgets\UploadImages;
GalleryFormAsset::register($this);
$form = ActiveForm::begin(['layout' => 'horizontal', 'enableClientValidation' => false, 'options' => ['class' => 'gallery-form']]);
?>

	<?php 
echo $form->field($model, 'active')->checkbox();
?>

	<?php 
echo $form->field($model, 'image')->widget(UploadImage::className(), ['thumbAttribute' => 'thumb', 'maxFileSize' => 2048]);
?>

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

	<?php 
if ($model->object !== null) {
    echo $form->field($model, 'alias');
}
?>

	<?php 
echo $form->field($model, 'description')->textarea(['rows' => 3]);
?>