drago-ex/application
Composer 安装命令:
composer require drago-ex/application
包简介
Extension for Nette Framework, providing reusable UI components, alert types, and flash message handling.
README 文档
README
The Drago Extension is a package built on top of the Nette Framework, designed to provide several useful components for your web applications. Below are the classes in the extension and how you can use them.
Requirements
- PHP >= 8.3
- Nette Framework
- Composer
- Bootstrap
- Naja
Installation
composer require drago-ex/application
Project files
File copying is handled automatically by drago-ex/project-tools,
which must be installed in your project. Without it, copy the files manually according to the copy section
in this package's composer.json. To skip this package, set "skip": true under
extra.drago-tools.packages.<package-name> in your root composer.json.
Check if there is a pair signal receiver and name (default is edit).
$this->getSignal();
Is AJAX request?
Shorter method in control.
$this->isAjax();
Retrieves a form component by its name.
$form = $this['factory']; $submitButton = $this->getFormComponent($form, 'submit'); $submitButton->setCaption('Edit');
Form factory with a custom form class
Use Drago\Application\UI\Factory when you want a typed factory for another form class, for example ExtraForms from drago-ex/form.
use Drago\Form\ExtraForms; /** * @extends \Drago\Application\UI\Factory<ExtraForms> */ readonly class Factory extends \Drago\Application\UI\Factory { protected function createForm(): ExtraForms { return new ExtraForms; } }
Base template class extending Nette Template.
Use it in presenter or control PHPDoc:
/** * @property-read Drago\Application\UI\ExtraTemplate $template */ class Presenter {}
In Latte, we will use these macros to insert into the template, which will tell us the variables and types that can be used by default in the template.
{templateType Drago\Application\UI\ExtraTemplate} {varType Drago\Application\UI\Flashes[] $flashes} {include 'path/to/@flash-message.latte', flashes: $flashes}
Flash message alert type
Toast - Bootstrap and Naja component for flash messages
JavaScript setup
Since the package is installed via Composer, add the following to your package.json:
{
"type": "module",
"dependencies": {
"drago-application": "file:vendor/drago-ex/application"
}
}
Then run npm install.
import ToastHandler from 'drago-application/bootstrap-toast';
Using toast in a Latte template
{include 'path/to/@toast.latte', flashes: $flashes}
drago-ex/application 适用场景与选型建议
drago-ex/application 是一款 基于 Latte 开发的 Composer 扩展包,目前已累计 4.01k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 01 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 drago-ex/application 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 drago-ex/application 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 7
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-31