kmj / toolkitbundle

Symfony2 Bundle,增加基本用户账户实体以及城市/州/国家设置

安装次数 2,211

依赖者: 1

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

类型:symfony-bundle

v1.1.0 2015-01-13 16:42 UTC

This package is auto-updated.

Last update: 2024-09-08 03:38:18 UTC


README

Codeship Status for Demoboy/ToolkitBundle SensioLabsInsight Coverage Status Latest Stable Version Total Downloads

  1. 安装

KMJToolkitBundle可以通过Composer方便地安装。只需从您的项目目录运行以下命令

composer require "kmj/toolkitbundle":1.1.*

现在,Composer将自动下载所有必需的文件,并为您安装它们。接下来只需更新您的AppKernel.php文件,并注册新捆绑包

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new KMJ\SyncBundle\KMJToolkitBundle(),
    // ...
);
  1. 配置

此捆绑包附带一些配置选项。

kmj_toolkit:
    rootdir:            #The root directory of the application defaults to %kernel.root_dir%
    enckey:             #The encryption key to use to encrypt documents
    administrator:
        firstname:      #Admin user's first name
        lastname:       #Admin user's last name
        username:       #Admin user's username
        email:          #Admin user's email address
        password:       #Admin user's password
  1. 功能

此捆绑包的目标是提供快速设置Symfony2项目。这些功能包括

* Quick load of countries and states (including relationships) into database through Doctrine fixtures or Alice fixtures (suggested)
* Address entity that manages addresses
* User class that uses roles as a relationship instead of FOSUser bundle storing them as an array
* Address type for handling user submitted addresses
* User type for registering users
* Role Hierarchy
* Quick setup of a super user in the db
* Document entities for handling user submitted documents
  1. 文档

此捆绑包还提供了实体来处理文档。EncryptedDocument和HiddenDocument的实例都保存在app/Resources/protectedDocuments文件夹中,而WebDocument的实例保存在web/uploads/documents。根据实体,它还会在写入文件系统时加密文档。文件在实体持久化到数据库时使用生命周期回调自动保存到文件系统。要查看或下载这些文件,已提供了一个控制器。要使用以下twig片段提供下载文档的链接

{{ path("kmj_toolkit_document_download(encrypted|hidden)", document: document.id) }}

要包含图像或视图,可以使用

{{ path("kmj_toolkit_document_view(encrypted|hidden)", document: document.id) }}

WebDocument的实例没有提供辅助方法,因为它们可以通过传统的HTTP请求访问。