codifico/actions 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

codifico/actions

Composer 安装命令:

composer require codifico/actions

包简介

Action component

README 文档

README

Common action based coupled to components:

Allows you to quickly create CRUD actions.

Scrutinizer Code Quality SensioLabsInsight

Latest Stable Version Latest Unstable Version Total Downloads License

Instalation

php composer.phar require codifico/actions:dev-master

Usage

Prepare your repository to be able to work with actions:

class MyRepository implements ActionRepository
{
    //(...)
}

### Basic

If you want to use the basic version (based on Form and HttpFoundation Components), create your own classes:

```php
use Codifico\Component\Actions\Action\Basic\CreateAction;
use Codifico\Component\Actions\Action\Basic\IndexAction;
use Codifico\Component\Actions\Action\Basic\RemoveAction;
use Codifico\Component\Actions\Action\Basic\UpdateAction;

class MyEntityCreateAction extends CreateAction 
{
    //(...)
}

class MyEntityIndexAction extends IndexAction
{
    //(...)
}

class MyEntityRemoveAction extends RemoveAction
{
    //(...)
}

class MyEntityUpdateAction extends UpdateAction
{
    //(...)
}

and at last, but not at least use then:

//Create:
$create = new MyEntityCreateAction($repository, $formFactory, $myEntityType);
$create->execute();

//Index:
$index = new MyEntityIndexAction($repository);
$index->setCriteria($criteria)->execute();

//Remove:
$remove = new MyEntityRemoveAction($repository);
$remove->setObject($object)->execute();

//Update:
$update = new MyEntityUpdateAction($formFactory, $myEntityType);
$update->setObject($object)->execute();

Custom

Otherwise, you might want to use interfaces:

  • Codifico\Component\Actions\Action\CreateAction
  • Codifico\Component\Actions\Action\RemoveAction
  • Codifico\Component\Actions\Action\UpdateAction

or even:

  • Codifico\Component\Actions\Action\Action

Copyright

Copyright (c) 2015 Marcin Dryka (drymek). See LICENSE for details.

Contributors

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-28