sateler/yii2-document

Yii2 model for storing documents

Installs: 47

Dependents: 0

Suggesters: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 1

Type:yii2-extension

1.0.1 2017-07-14 20:47 UTC

README

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist sateler/yii2-document "^1.0"

or add

"sateler/yii2-document": "^1.0"

to the require section of your composer.json file.

Once the extension is installed, add namespace to console config:

return [
    'controllerMap' => [
        'migrate' => [
            'class' => 'yii\console\controllers\MigrateController',
            'migrationNamespaces' => [
                'sateler\document\migrations',
            ],
        ],
    ],
];

And controller to web config:

return [
    'controllerMap' => [
        'documents' => [
            'class' => 'sateler\document\controllers\DocumentController',
        ]
    ],
];

Usage

Once installed, you can now use sateler\document\Document in your relations, and redirect to ['documents/view', 'id' => $docId] to view or download.