定制 andrewdanilov/yii2-input-images 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

andrewdanilov/yii2-input-images

Composer 安装命令:

composer require andrewdanilov/yii2-input-images

包简介

Input images widget

README 文档

README

Widget building form fields for uploading single or multiple images. It extends and requires extension MihailDev/yii2-elfinder

Installation

The preferred way to install this extension is through composer.

Either run

composer require andrewdanilov/yii2-input-images "~1.0.0"

or add

"andrewdanilov/yii2-input-images": "~1.0.0"

to the require section of your composer.json file.

Usage

For use without a file manager

In your config/main.php add:

return [
	// ...
	'controllerMap' => [
		'uploader' => [
			'class' => 'andrewdanilov\InputImages\UploadController',
			'path' => '@frontend/web/upload/post/images', // writable path to upload images to, default is '@webroot/upload/images'
            'baseUrl' => '/upload/post/images', // base url to uploaded images, default is '/upload/images'
		],
	],
];

Then in view just add a widget call:

<?php
use andrewdanilov\InputImages\InputImagesSimple;
?>

<?php $form = ActiveForm::begin(); ?>                              
<?= $form->field($model, 'logo')->widget(InputImagesSimple::class) ?>
<?php ActiveForm::end(); ?>

For use with the file manager

In your config/main.php add:

return [
	// ...
	'controllerMap' => [
		'elfinder' => [
			'class' => 'mihaildev\elfinder\Controller',
			'access' => ['admin'],
			'roots' => [
				[
					'baseUrl' => '',
					'basePath' => '@frontend/web',
					'path' => 'upload/images',
					'name' => 'Изображения',
				],
			],
		],
	],
];

And then add form in your view:

<?php
use andrewdanilov\InputImages\InputImages;
?>

<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'logo')->widget(InputImages::class) ?>
<?php ActiveForm::end(); ?>

统计信息

  • 总下载量: 220
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-03-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固