atk14/range-field 问题修复 & 功能扩展

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

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

atk14/range-field

Composer 安装命令:

composer require atk14/range-field

包简介

RangeField is a form field for entering numeric range from and to in ATK14 applications

README 文档

README

RangeField is a field for entering two numeric values within specified minimum and maximum.

In eshops, this is an useful field, for example, for setting the price range for product selection.

Usage

<?php
// file: app/forms/products/index_form.php
class IndexForm extends ApplicatonForm {

  function set_up(){
    $this->add_field("search", new CharField([
      "label" => "Search",
      "required" => false,
    ]));

    $this->add_field("price", new RangeField([
      "label" => "Price range",
      "min_value" => 1,
      "max_value" => 100000,
      "required" => false,
    ]));
  }
}

<?php
// file: app/controllers/products_controller.php
class ProductsController extends ApplicationController {

  function index(){
    $d = $this->form->validate($this->params);

    $min = $d["price"]["min"];
    $max = $d["price"]["max"];

    // ..
  }
}

Installation

Just use the Composer:

cd path/to/your/atk14/project/
composer require atk14/range-field

Optionally you can symlink RangeField files into your project:

ln -s ../../vendor/atk14/range-field/src/app/fields/range_field.php app/fields/range_field.php
ln -s ../../vendor/atk14/range-field/src/app/widgets/range_input.php app/widgets/range_input.php

Testing

composer update --dev
cd test
../vendor/bin/run_unit_tests

License

RangeField is free software distributed under the terms of the MIT license

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固