smartsolutionsitaly/cakephp-locale-type

CakePHP 的区域类型

1.0.1 2019-05-24 07:53 UTC

This package is auto-updated.

Last update: 2024-09-24 20:09:36 UTC


README

LICENSE packagist issues CakePHP

用于 CakePHP 的区域类型

安装

您可以使用 Composercakephp-locale-type 安装到您的项目中。

$ composer require smartsolutionsitaly/cakephp-locale-type

设置

在您的 config/bootstrap.php 文件的底部插入以下行

Type::map('locale', 'SmartSolutionsItaly\CakePHP\Database\Type\LocaleType');

并在您的 Table 类中添加或编辑 _initializeSchema 方法。

protected function _initializeSchema(\Cake\Database\Schema\TableSchema $schema)
{
    $schema->setColumnType('your_column_name', 'locale');

    return $schema;
}

许可证

根据 MIT 许可证许可。有关完整的版权和许可信息,请参阅 LICENSE 文件。文件的分发必须保留上述版权声明。

版权

版权所有(c)2018-2019 Smart Solutions S.r.l. (https://smartsolutions.it)