spiral / vault
Extendable, materialize design based, administration panel
Installs: 3 430
Dependents: 4
Suggesters: 0
Security: 0
Stars: 4
Watchers: 4
Forks: 2
Open Issues: 8
Language:CSS
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
Documentation | CHANGELOG | Framework Bundle
Vault administration panel provides ability use regular application controllers inside Security enviroment with set of pre-created visual elements like grids, tabs, forms and other.
Vault module is based on a set of Materialize CSS styles.
Elements included
In-Vault Uri tag (URL automatically resolved via Vault route):
<vault:uri target="controller:action" options="<?= ['id' => 123] ?>" icon="icon" class="..."> label </vault:uri>
Cards and blocks:
<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>
Forms (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>
Tabs:
<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>
Grids:
/** * @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>
Installation
composer require spiral/vault
spiral register spiral/vault
Add following bootloader to your application:
[ \Spiral\Listing\Bootloaders\ListingsBootloader::class, \Spiral\Vault\Bootloaders\VaultBootloader::class, ]
You can tweak Vault behaviour (route, middlewares), create new navigation sections or register your own controllers via
app/config/modules/vault.php
configuration file.
If you wish to play with Vault without configuring security rules (development only):
[ \Spiral\Listing\Bootloaders\ListingsBootloader::class, \Spiral\Vault\Bootloaders\VaultBootloader::class, \Spiral\Vault\Bootloaders\InsecureBootloader::class ]