承接 dala00/cakephp-simple-upload 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

dala00/cakephp-simple-upload

Composer 安装命令:

composer require dala00/cakephp-simple-upload

包简介

Upload handle plugin for CakePHP

README 文档

README

Software License Build Status Coverage Status

Description

  • Handle file post to save and upload automatically.
  • UploadHelper can output URL and img tag on template.
  • Methods for confirm page are available.

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require dala00/cakephp-simple-upload

And load plugin on bootstrap.php.

Plugin::load('Dala00/Upload');

Usage

Load UploadBehavior with options.

class SomeTable extends Table {
	public function initialize(array $config) {
		$this->addBehavior('Dala00/Upload.Upload', [
			'fields' => [
				'photo' => [
					'path' => 'webroot{DS}files{DS}{model}{DS}{primaryKey}{DS}{field}{DS}'
				],
			],
		]);
	}
}

UploadHelper

You can output URL or img tag with UploadHelper.

// In Controller
public $helpers = ['Dala00/Upload.Upload'];
(In Templates)
<img src="<?= $this->Upload->url($entity, $fieldName) ?>">
or
<?= $this->Upload->image($entity, $fieldName) ?>
<?= $this->Upload->image($entity, $fieldName, $options) ?>

Using confirm page

If you want show confirm page before saving post, next method saves files as cache.

// Call in action when confirm page will be shown
$this->SomeTable->uploadTmpFile($entity);
// Output hidden tag with UploadHelper on templates
<?= $this->Upload->hidden($entity, $fieldName) ?>

Licence

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固