azmanabdlh/gargantua
最新稳定版本:1.0.0
Composer 安装命令:
composer require azmanabdlh/gargantua
包简介
Minimalist form wizard library.
关键字:
README 文档
README
Form wizard can be challenging and may require a higher effort to complete them. Gargantua is a minimalist form wizard library.
Table of Content
Installation
Before you install, it is important to check that your PHP version at least PHP 7.1+.
composer require azmanabdlh/gargantua
Quick Start
Read the example test to get started.
API
Form
use Gargantua\Contract\Session; use Gargantua\Contract\Page; use Gargantua\Contract\Request; public static function provide( Page[] $page, Session $session, ): Form
// get current page utils. public function page(): PageUtils
// check form page can be navigate back. public function canBack(): bool
// check form page is last. public function last(): bool
Page
Page provide a form page
// provide form page name. public function pageName(): string
// when form page submitted try to invoke func. public function onSubmit(Request $request): void
// try to move the next page can invoke func. public function onNext(array $payload): void
// when it reaches the tail, each form page invoke func. public function onCompleted(): void
use Gargantua\Contract\CanNavigateBack; // try back to the prev page can invoke func. public function onNavigateBack(): void
PageUtils
PageUtils provide Page utilities
// validate page is active. public function is(string $pageName): bool
// get page label. public function label(): string
// get page icon. public function icon(): string // example public function icon(): string { return "<img .../>"; // or <i icon="user-account"></i> }
// get current page number. public function number(): int
Cable
Intercept form page using Cable for each Page submitted.
$form->capture([ new VerifyJwtToken() ]); // handle logic. function handle(Request $request): void
License
Licensed under MIT. Totally free for private or commercial projects, or any other uses.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-22
