定制 cakephp-tutorial/autodate 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

cakephp-tutorial/autodate

最新稳定版本:1.0.1

Composer 安装命令:

composer require cakephp-tutorial/autodate

包简介

Automatically convert date fields

README 文档

README

A CakePHP Plugin that will auto convert date fields from SQL format to a chosen date format (eg: d/m/Y). Will auto convert the date before saving to database, before find (to match conditions on db), after find and after update

Total Downloads Latest Stable Version

Requirements

  • CakePHP 2
  • PHP 5.2

Compatibility

  • V 1.x - CakePHP 2

Usage

/**
 * Attach to AppModel to auto convert all date fields
 * or attach it to a single model
 **/
class AppModel extends Model {
    public $actsAs = array(
        'Autodate.Autodate' => array('dateformat' => 'd/m/Y')
    );
}

Available date Formats

  • 'd-m-Y'
  • 'd/m/Y'
  • 'Y/m/d'
  • 'Y-m-d'
  • 'Y-d-m'
  • 'Y/d/m'
  • 'm-d-Y'
  • 'm/d/Y'
  • 'Ymd'
  • 'Ydm'

Installation

Using composer

{
    "require": {
        "cakephp-tutorial/autodate": "1.0.0"
    }
}

Manually Installation

CakePlugin::load('Autodate');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-05