螺旋 / 金库
此包已被弃用,不再维护。未建议替代包。
可扩展、基于Materialize设计的后台管理面板
v0.9.11
2018-04-02 09:11 UTC
Requires
- spiral/framework: ^1.0
- spiral/listing: ^0.9.1
- spiral/toolkit: ^0.9.11
Requires (Dev)
- mockery/mockery: dev-master
- phpunit/phpunit: ~6.0
- dev-master
- v0.9.11
- v0.9.10
- v0.9.9
- v0.9.8
- v0.9.7
- v0.9.6
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.23
- v0.1.22
- v0.1.21
- v0.1.20
- v0.1.19
- v0.1.18
- v0.1.17
- v0.1.16
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.1
- v0.1
- dev-add-context-to-allowed-tag
- dev-vault-listing-bugfix
- dev-vvval-patch-4
- dev-feature/node-package
- dev-develop
- dev-feature/styles-edit
- dev-native-select
- dev-updated-materialize
This package is auto-updated.
Last update: 2024-01-29 02:37:59 UTC
README
金库管理面板提供在安全环境中使用常规应用程序控制器的能力,并附带一系列预先创建的视觉元素,如网格、标签页、表单和其他。
金库模块基于一系列Materialize CSS样式。
包含的元素
金库Uri标签(通过金库路由自动解析的URL)
<vault:uri target="controller:action" options="<?= ['id' => 123] ?>" icon="icon" class="..."> label </vault:uri>
卡片和块
<vault:card color="blue-grey darken-2" text="white"> <p>There is an issue with something.</p> </vault:card> <vault:block title="Title"> content </vault:block>
表单(ajax)
<vault:form action="<?= vault()->uri('countries:edit', ['id' => $entity->id]) ?>"> <div class="row"> <div class="col s7"> <form:input label="[[Country:]]" name="name" value="<?= e($entity->name) ?>"/> </div> <div class="col s5"> <form:input label="[[Country Code:]]" name="code" value="<?= e($entity->code) ?>"/> </div> </div> <div class="right-align"> <input type="submit" value="[[UPDATE]]" class="btn teal waves-effect waves-light"/> </div> </vault:form>
标签页
<extends:vault:layout title="[[Vault]]"/> <block:content> <tab:wrapper> <!--Primary information about user account--> <tab:item id="info" title="User Information" icon="user"> <div class="row"> <div class="col s6"> <vault:block> <spiral:form> <form:input label="abc"/> </spiral:form> </vault:block> </div> <div class="col s6"> <vault:card color="blue-grey darken-2" text="white"> <p>There is an issue with something.</p> </vault:card> </div> </div> </tab:item> <!--Additional information about user account--> <tab:item id="extra" title="Extra Information"> extra user information <vault:uri target="controller:action">link</vault:uri> </tab:item> </tab:wrapper> </block:content>
网格
/** * @return string */ protected function indexAction(PostsSource $source) { return $this->views->render('admin/posts/list', [ 'posts' => $source->findActive()->paginate(5) ]); }
<extends:vault:layout title="Posts"/> <define:content> <vault:grid source="<?= $posts ?>" as="post"> <grid:cell label="ID:" value="<?= $post->id ?>"/> <grid:cell label="Time Created:" value="<?= $post->time_created ?>"/> <grid:cell label="Title:" value="<?= $post->title ?>"/> <grid:cell.bool label="Published:" value="<?= $post->isPublished() ?>"/> <grid:cell style="text-align: right"> <vault:uri target="posts:edit" options="<?= ['id' => $post->id] ?>" class="waves-effect btn-flat" icon="edit"/> </grid:cell> </vault:grid> </define:content>
安装
composer require spiral/vault
spiral register spiral/vault
将以下引导加载器添加到您的应用程序中
[ \Spiral\Listing\Bootloaders\ListingsBootloader::class, \Spiral\Vault\Bootloaders\VaultBootloader::class, ]
您可以通过
app/config/modules/vault.php
配置文件调整金库的行为(路由、中间件),创建新的导航部分或注册您自己的控制器。
如果您想在不配置安全规则的情况下试用金库(仅限开发)
[ \Spiral\Listing\Bootloaders\ListingsBootloader::class, \Spiral\Vault\Bootloaders\VaultBootloader::class, \Spiral\Vault\Bootloaders\InsecureBootloader::class ]