tatter/frontend
Composer 安装命令:
composer require tatter/frontend
包简介
Opinionated suite of frontend tech for CodeIgniter 4
README 文档
README
Opinionated suite of frontend tech for CodeIgniter 4
Description
This library leverages Tatter\Assets alongside the framework's Publisher Library to automate asset discovery and HTML tag injection for an opinionated selection of frontend solutions.
Installation
Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:
composer require tatter/frontend
Or, install manually by downloading the source files and adding the directory to app/Config/Autoload.php.
Once the files are downloaded and included in the autoload run the framework's publish
command to inject all assets into your front controller path:
php spark publish
Included Solutions
Asset Libraries
- AdminLTE - Admin dashboard template
- Bootstrap - Mobile-first front-end CSS framework directed at responsive web development
- DataTables - To enhance the accessibility of data in HTML tables
- FontAwesome - Popular icon set and toolkit for vector icons and social logos
- jQuery - A fast, small, and feature-rich JavaScript library
Support Libraries
*Note: jQuery is included because some other libraries depend on it; should those libraries remove it as a dependency or be removed themselve then jQuery will no longer be included.
Versioning
The intent is to maintain two major versions of this library for an indefinite amount of time until AdminLTE 4 is fully released and stable for production use. The core differences will be around the dependency stack for AdminLTE, Bootstrap, and jQuery.
| Library version | Bootstrap version | AdminLTE version | jQuery |
|---|---|---|---|
1.x |
4.x |
3.x |
Yes |
2.x |
5.x |
4.x |
No |
Configuration
For full configuration details see the Assets docs.
Enable the AssetsFilters on any "after" routes where you want tags applied. To apply
them everywhere simply add to $globals. app/Config/Filters.php:
/** * List of filter aliases that are always * applied before and after every request. * * @var array */ public $globals = [ 'before' => [ // 'honeypot', // 'csrf', ], 'after' => [ 'assets', ], ];
Then create or edit your Assets config file and add each bundle for the routes where you
want them to be applied. app/Config/Assets.php:
<?php namespace Config; use Tatter\Frontend\Bundles\AdminLTEBundle; use Tatter\Frontend\Bundles\BootstrapBundle; use Tatter\Frontend\Bundles\FontAwesomeBundle; class Assets extends \Tatter\Assets\Config\Assets { public $routes = [ '*' => [ BootstrapBundle::class, FontAwesomeBundle::class, ], 'admin/*' => [ AdminLTEBundle::class, ChartJSBundle::class, ], 'files/upload' => [ DropzoneJSBundle::class, ] ]; }
Note that each Bundle includes its dependency (e.g. AdminLTE includes Bootstrap, Bootstrap includes jQuery), so while there is no harm in repeating assets it is also unnecessary. This does not extend to optional plugins, e.g. if you want to use FontAwesome in AdminLTE you will need to include both.
Testing
This library includes a PHPUnit extension classes in src/Test/ to assist with testing
vendor-sourced Publishers. Tatter\Assets has a similar test case for Bundles. These two
classes are used to test the files from this library but are also available for other projects
that use Tatter\Frontend. To test your own classes simply extend the appropriate test case
and add a data provider method with your class name and criteria to meet. See the test files
in tests/ for examples.
tatter/frontend 适用场景与选型建议
tatter/frontend 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.39k 次下载、GitHub Stars 达 12, 最近一次更新时间为 2021 年 12 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「assets」 「javascript」 「css」 「codeigniter」 「frontend」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tatter/frontend 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tatter/frontend 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tatter/frontend 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
Asset Management for PHP
Caching and compression for Twig assets (JavaScript and CSS).
A pretty nice way to expose your translation messages to your JavaScript.
PHP client for the Google Closure Compiler API in one file.
统计信息
- 总下载量: 5.39k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 11
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-13