drago-ex/application
最新稳定版本:v1.0.28
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
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');
Base template class extending Nette Template.
It is used in the bow of presenters or control
/** * @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} <div n:foreach="$flashes as $flash" n:class="flash, $flash->type">{$flash->message}</div>
Flash message alert type
Toast - Bootstrap and naja component for flash messages
import BootstrapComponents from 'path/to/naja.toast';
Using toast in a latte template
{include 'path/to/@toast.latte', flashes => $flashes}
Copy the Latte template from assets to your project.
统计信息
- 总下载量: 3.44k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-31