2017 © Pedro Peláez
 

yii-component yii-artimestamps

Timestamps created_at and updated_at with date format for ActiveRecord

image

trex/yii-artimestamps

Timestamps created_at and updated_at with date format for ActiveRecord

  • Saturday, December 23, 2017
  • by tekoraik
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

trex-yii-artimestamps

Timestamps created_at and updated_at with date format for ActiveRecord, (*1)

Instalation

Via composer:, (*2)

composer require trex/yii-artimestamps

or add this lines in your composer.json:, (*3)

"trex/yii-artimestamps": "*"

Usage

1. Add a create column and update column in your table, (*4)

2. Add the behavior in your ActiveRecord, (*5)

public function behaviors()
{
    return [
        "timestamp" => [
            'class' => \trex\yii\artimestamps\TimestampBehavior::className(),
            'createdAtField' => '{{ my create field }}',
            'updatedAtField' => '{{ my update field }}',
            'format' => 'Y-m-d H:i:s' //this is optional
        ]
    ];
}

The Versions

23/12 2017

dev-master

9999999-dev

Timestamps created_at and updated_at with date format for ActiveRecord

  Sources   Download

The Requires

 

The Development Requires

by Jose Luis Orta