crabstudio/ace
最新稳定版本:1.0.1
Composer 安装命令:
composer require crabstudio/ace
包简介
CakePHP 3 bake theme, integrated with Ace Admin template, UserActivityLogging, SoftDeleteRestore. For more, please look at README.md file
关键字:
README 文档
README
DEPRECATED: use this Skeleton as replacement
Introduction
This plugin integrated with ACE responsive theme, breadcrumb automatic add to your view.
You can generate all (controller, model, template) with this plugin.
By default, the generated controller integrated with UserActivityTrait (need Auth component to run)
If you do not need this feature, do not bake controller with Crabstudio/Ace
The generated model integrated with SoftDeleteRestoreTrait, this trait allow you to soft delete (not really wiped out record) and you can restore.
If you do not need this feature, do not bake model with Crabstudio/Ace
I just hold single license, you must buy ACE theme license for your project
Installation
You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
composer require crabstudio/ace
Or add the following lines to your application's composer.json:
"require": {
"crabstudio/ace": "^1.0"
}
followed by the command:
composer update
Load plugin
Add this line to Your_project\config\bootstrap.php
Plugin::load('Crabstudio/Ace', ['bootstrap' => true]);
Use backend layout
Your must copy all files, folders in Crabstudio/Ace/webroot/ to your_project/webroot
Copy Crabstudio/Ace/src/Template/Layout/backend.ctp to your_project/src/Template/Layout/
Copy all files in folder Crabstudio/Ace/src/Template/Element/ to your_project/src/Template/Layout/Element/
Then in your controller, set layout
$this->_viewBuilder->layout('backend');
Bake template
Windows:
your_project>bin\cake bake all Users --theme Crabstudio/Ace
Linux, Unix:
your_project>bin/cake bake all Users --theme Crabstudio/Ace
Bonus more offer
This plugin provide some global function and you can call from anywhere:
format_date($time, $timezone, $format);
str_slug($source);
SluggableBehavior
Usage format_date function
/**
* Format date use Cake\I18n\Time class with default timezone "Asia/Tokyo"
* and default format "yyyy/MM/dd HH:mm:ss"
*
* @param date $time
* @param string $timezone
* @param string $format
* @return string
*/
Ex:
$formatedDate = format_date($user->created_at);
echo $formatedDate; //2015/09/24 03:00:00
$formatedDate = format_date($user->created_at, 'Asia/Bangkok');
echo $formatedDate; //2015/09/24 01:00:00
$formatedDate = format_date($user->created_at, 'Asia/Bangkok', 'HH:mm:ss dd/MM/yyyy');
echo $formatedDate; //01:00:00 24/09/2015
Usage str_slug function
/**
* Do unsigned utf-8 characters and make friendly-link-like-this
*
* @param string $source
* @return string
*/
echo str_slug('Nguyễn Anh Tuấn'); //nguyen-anh-tuan
Usage SluggableBehavior
In your Model Table, insert this one into function initialize:
/**
* Do unsigned utf-8 characters and make friendly-link-like-this
*
* @param string $source name of field hold source string
* @param string $replacement name of field will store slugged string
* @return string
*/
$this->addBehavior('Crabstudio/Ace.Sluggable', [
'field' => 'title',
'slug' => 'slug',
]);
Demo result
crabstudio/ace 适用场景与选型建议
crabstudio/ace 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 161 次下载、GitHub Stars 达 3, 最近一次更新时间为 2015 年 09 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cakephp3」 「crabstudio」 「anhtuank7c」 「bake template」 「code generation tool」 「ace theme」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 crabstudio/ace 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 crabstudio/ace 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 crabstudio/ace 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easily use Google Recaptcha in CakePHP projects
AclManager plugin for CakePHP 3.x
AWS S3 datasource in CakePHP3
StateMachineBehavior for CakePHP 3
Makes scheduling tasks in CakePHP much simpler.
A CakePHP plugin to convert your price from a currency to another
统计信息
- 总下载量: 161
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-24