demyanenkomaks/yii2-base

Yii 2 Advanced Project Template

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Language:JavaScript

Type:project

v1.0.0 2021-10-19 07:45 UTC

This package is auto-updated.

Last update: 2022-08-06 15:01:39 UTC


README

993323

Yii 2 Advanced Project Template


DIRECTORY STRUCTURE

common
    config/              contains shared configurations
    mail/                contains view files for e-mails
    models/              contains model classes used in both backend and frontend
    tests/               contains tests for common classes    
console
    config/              contains console configurations
    controllers/         contains console controllers (commands)
    migrations/          contains database migrations
    models/              contains console-specific model classes
    runtime/             contains files generated during runtime
backend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains backend configurations
    controllers/         contains Web controller classes
    models/              contains backend-specific model classes
    runtime/             contains files generated during runtime
    tests/               contains tests for backend application    
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
frontend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains frontend configurations
    controllers/         contains Web controller classes
    models/              contains frontend-specific model classes
    runtime/             contains files generated during runtime
    tests/               contains tests for frontend application
    views/               contains view files for the Web application
    widgets/             contains frontend widgets
vendor/                  contains dependent 3rd-party packages
environments/            contains environment-based overrides
web/                 contains frontend the entry script and Web resources

INSTALLATION

Install via Composer

If you do not have Composer, you may install it by following the instructions at getcomposer.org.

composer create-project demyanenkomaks/yii2-base or git clone ...
php init
php yii migrate-all

Update project

git pull --ff-only origin dev
composer install
php yii migrate --interactive=0

Console Rbac

php yii rbac/remove-all                             Удалить все данные: роли, разрешения, правила и назначения

php yii rbac/init-role-admin                        Добавленеи роли "admin" с доступом Управление пользователями
php yii rbac/init-role-admin-all                    Добавленеи роли "admin" с доступом ко всему

php yii rbac/add-admin {login} {password}           Добавленеи пользователя с ролью "admin"
php yii rbac/recovery-role-admin {login}            Востановление пользователю роли "admin"
php yii rbac/recovery-password {login} {password}   Востановление пароля пользователю