orken/select-behavior-cakephp3 问题修复 & 功能扩展

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

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

orken/select-behavior-cakephp3

Composer 安装命令:

composer require orken/select-behavior-cakephp3

包简介

Select Finder Behavior for CakePHP 3+

README 文档

README

Create a key-value list with an optionnal group key, compatible with the method find('list').

When you want to use 'list' results in javascript, it can be a little tricky because of the lack of fixed key. So, this behavior helps you to get a JS-friendly format for your lists.

With normal find('list') you'll get your results as :

$list = [
  "31555" => "Toulouse",
  "31075" => "Bonrepos sur aussonnelle",
  ...
]

or, with a groupField key :

$list = [
  "Midi-Pyrénées" => [
    "31555" => "Toulouse",
    "31075" => "Bonrepos sur aussonnelle",
    ...
  ],
  ...
]

With the behavior 'select', with find('select') you'll get results as :

$list = [
  [
    "items" => [
      [
        "key"   => "31555",
        "value" => "Toulouse"
      ],
      [
        "key"   => "31075",
        "value" => "Bonrepos sur Aussonnelle"
      ],
      ...
    ]
  ]
]

and with a groupField key :

$list = [
  [
    "group" => "Midi-Pyrénées",
    "items" => [
      [
        "key"   => "31555",
        "value" => "Toulouse"
      ],
      [
        "key"   => "31075",
        "value" => "Bonrepos sur Aussonnelle"
      ],
      ...
    ]
  ],
  ...
]

##Installation

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

The recommended way to install composer packages is:

composer require orken/select-behavior-cakephp3

Setting up your CakePHP application

In your bootstrap.php

Plugin::load('SelectBehavior');

In each Model/Table file you want to use this behavior add

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

Usage

Syntax is fully complatible with find('list'). Use find('select') instead.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固