kmj/toolkitbundle

Symfony2 Bundle that adds basic user account entity and city/state/country setup as well

Installs: 2 213

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

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

This package is auto-updated.

Last update: 2024-10-08 03:56:10 UTC


README

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

  1. Installation

KMJToolkitBundle can conveniently be installed via Composer. Just run the following command from your project directory

composer require "kmj/toolkitbundle":1.1.*

Now, Composer will automatically download all required files, and install them for you. All that is left to do is to update your AppKernel.php file, and register the new bundle:

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

This bundle comes with a few configuration options.

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. Features

This bundle's goal is to provide quick setup of a Symfony2 project. These features include:

* 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. Documents

This bundle also provides Entity to handle documents. Instances of EncryptedDocument and HiddenDocument are all saved to the app/Resources/protectedDocuments folder and instances of WebDocument are saved to web/uploads/documents Based on the entity it will also encrypt documents as it is written to the file system. The files are automatically saved to file system during when the entity is persisted to the database using lifecycle callbacks. To view or download these files a controller has been provided. To provide a link to download a document use the following twig snippet:

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

And to include an image or view inline you can use:

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

There are no helper methods for instances of WebDocument as they are accessible through traditional HTTP requests