trex / yii-artimestamps
There is no license information available for the latest version (dev-master) of this package.
Timestamps created_at and updated_at with date format for ActiveRecord
Package info
github.com/tekoraik/trex-yii-artimestamps
Type:yii-component
pkg:composer/trex/yii-artimestamps
dev-master
2017-12-23 10:55 UTC
Requires
- php: >=5.4.0
- yiisoft/yii2: ~2.0.5
Requires (Dev)
- codeception/base: ^2.2.3
- codeception/specify: ~0.4.3
- codeception/verify: ~0.3.1
- yiisoft/yii2-debug: ~2.0.0
- yiisoft/yii2-faker: ~2.0.0
- yiisoft/yii2-gii: ~2.0.0
This package is not auto-updated.
Last update: 2026-03-15 09:42:19 UTC
README
Timestamps created_at and updated_at with date format for ActiveRecord
Instalation
Via composer:
composer require trex/yii-artimestamps
or add this lines in your composer.json:
"trex/yii-artimestamps": "*"
Usage
1. Add a create column and update column in your table
2. Add the behavior in your ActiveRecord
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
]
];
}