承接 hmic/cakephp-blame 相关项目开发

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

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

hmic/cakephp-blame

最新稳定版本:0.3

Composer 安装命令:

composer require hmic/cakephp-blame

包简介

CakePHP plugin for blaming a user (from AuthComponent) for save action on models.

README 文档

README

CakePHP 3.0 plugin to update e.g. created_by and modified_by fields. Idea taken from and originates of ceeram/blame

Installation

Add the following lines to your application's composer.json:

	"require": {
		"hmic/cakephp-blame": "dev-master"
	}

followed by the command:

composer update

Or run the following command directly without changing your composer.json:

composer require hmic/cakephp-blame:dev-master

OR: Create a plugins/Blame dir under your app's dir and checkout this repo and make sure ['autoload' => true] is set when loading the plugin like shown below.

Usage

In your app's config/bootstrap.php add: Plugin::load('Blame', ['autoload' => true]);

Configuration

Add the following line to your AppController:

	use \Blame\Controller\BlameTrait;

Attach the behavior in the models you like to use. Please note that these need to have the following 2 fields in the database table for it to work: created_by int(11) NULL and modified_by int(11) NULL

	public function initialize(array $config) {
		$this->addBehavior('Blame.Blame');
	}

Routing

Has been fixed in the core in the meantime - just works right now! This is work in progress, but you can have routing working, for use with baked views, (works only for the default configuration for now) by adding this to your app's config/routes.php directly defore the $routes->fallbacks(); and commenting that out, like this:

	$routes->connect('/:controller', ['action' => 'index'], ['routeClass' => 'Blame.BlameRoute']);
	$routes->connect('/:controller/:action/*', [], ['routeClass' => 'Blame.BlameRoute']);
//	$routes->fallbacks();
## Bake If you want to bake your stuff you need to bake the model first, then add the behavior as shown above and afterwards bake the controller and views. It will take care of the associations automatically. For the routing of the baked views to work for the assocations too, see above.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固