Skip to content
No description, website, or topics provided.
PHP HTML Hack JavaScript CSS Shell Batchfile
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
behaviors
commands
components
config
controllers
helpers
interfaces
mail/layouts
messages
migrations
models
runtime
tests
traits
vagrant
views
web
widgets
.bowerrc
.gitignore
.scrutinizer.yml
LICENSE.md
README.md
Vagrantfile
changelog.md
codeception.yml
composer.json
composer.lock
docker-compose.yml
requirements.php
yii
yii.bat

README.md

Yii2 simple template install ducumentation

Scrutinizer Code Quality Build Status

1 Introduction

Yii2 simple project template, based on Yii2 basic framework. Project is available to install at Git Hub repository.

This template includes:

  • Admin panel, based on AdminLTE
  • Number of entities, which are managed by admin panel:
    • Site settings (Initial role and status after registration, e.t.c.)
    • Users
    • RBAC (Set roles and permissions for users)
    • Positions
    • Pages
      • Products (child products for pages)
    • Feedback
    • About (about company page)
      • Technologies (child)
      • Qualities (child)
    • Contacts
      • Social (child)
    • Home page
    • Site map

This template helps you to easy start your Yii2 project. And then you can change it as you like.

2 Dependencies

  • php >= 7.1
  • composer
  • MySql >= 5.5

3 Installation

  1. Clone project.

    SSH SOURCE:
    git@github.com:itstructure/yii2-template-simple.git
    
    HTTPS SOURCE:
    https://github.com/itstructure/yii2-template-simple.git
    
  2. Install dependencies by running from the project root composer install

  3. Create new data base.

  4. Copy file db_example.php to db.php. In file db.php set the settings according to the settings for accessing the MySql server. Enter the name of the created data base.

    Example:

    return [
        'class' => 'yii\db\Connection',
        'dsn' => 'mysql:host=localhost;dbname=yourdbname',
        'username' => 'root',
        'password' => 'passwordvalue',
        'charset' => 'utf8',
    ];
  5. Run the RBAC migration:

    yii migrate --migrationPath=@yii/rbac/migrations
    
  6. Run the command to build initial rbac entities:

    yii build-rbac
    

    Roles and permissions will be created with the following structure:

    |--------------------|-----------------------------|
    |                    |            Roles            |
    |                    |-----------------------------|
    | Permissions        |  admin  | manager |  user   |
    |--------------------|---------|---------|---------|
    | CREATE             |    X    |         |         |
    | UPDATE             |    X    |         |         |
    | DELETE             |    X    |         |         |
    | SET_ROLES          |    X    |         |         |
    | VIEW_BACKSIDE      |    X    |    X    |         |
    | VIEW_FRONTSIDE     |    X    |    X    |    X    |
    |--------------------|---------|---------|---------|
  7. Run MFU module migration:

    yii migrate --migrationPath=@mfuploader/migrations
    
  8. Run the application migration:

    yii migrate
    
  9. If you are going to use google captcha, it is necessary to set captcha params in new captcha.php config file:

    return [
        'site_key' => '...',
        'secret_key' => '...',
    ];
  10. If you are going to load some files to Amazon remote storage by MFUploader module, it is necessary to set AWS access params in new aws-credentials.php config file:

    return [
        'aws_access_key_id' => '...',
        'aws_secret_access_key' => '...',
    ];
You can’t perform that action at this time.