Yii2 Start Project Basic Template

Fund package maintenance!

Installs: 74

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 3

Forks: 2

Open Issues: 0


1.0.0 2018-02-27 14:22 UTC

This package is auto-updated.

Last update: 2024-05-25 23:14:18 UTC


Latest Stable Version License build Scrutinizer Code Quality Code Intelligence Status Total Downloads

The application is built using basic pattern and has a modular structure.

Base components


  • Home
  • About
  • Contact
  • Check in
  • Login
  • Profile


  • main
  • users
  • admin
  • rbac (manage web interface)


  • Reset password
  • Confirmation by email
  • Last visit
  • Console commands
  • RBAC

CSS Themes Bootstrap

The template includes the of the CSS Theme Bootstrap

Switching the theme occurs in the app/config/web.php


The minimum requirement by this project template that your Web server supports PHP 5.6


Create a project:

composer create-project --prefer-dist --stability=dev dominus77/yii2-basic-start basic-project

or clone the repository for pull command availability:

git clone basic-project
cd basic-project
composer install

Init an environment:

Run command in the root directory public_html of the project

if Development environment

composer app-init-dev

if Production environment

composer app-init-prod

otherwise choose Wednesday

php init

Create a database, default configure: yii2_basic_start in app/config/common-local.php

$config = [
    'components' => [
        'db' => [
            'dsn' => 'mysql:host=localhost;dbname=yii2_basic_start',

Apply migration:

composer migrate-up

Create users, enter the command and follow the instructions:

php yii users/user/create
  • Username: set username;
  • Email: set email username;
  • Password: set password username (min 6 symbol);
  • Status: set status username (0 - blocked, 1 - active, 2 - wait, ? - Help);

See all available commands:

php yii

Initialize RBAC

When initialized, the user with ID:1 is assigned the SuperAdmin role.

composer rbac-init

A command to assign roles to other users:

php yii rbac/roles/assign

To untie:

php yii rbac/roles/revoke

You can then access the application through the following URL:


Create .htaccess file or add folder app/web `

AddDefaultCharset utf-8
# Mod_Autoindex
<IfModule mod_autoindex.c>
  # Disable indexes
  Options -Indexes

# Mod_Rewrite
<IfModule mod_rewrite.c>
  # Enable symlinks
  Options +FollowSymlinks
  # Enable mod_rewrite
  RewriteEngine On

  # If a directory or a file exists, use the request directly
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  # Otherwise forward the request to index.php
  RewriteRule . index.php

Code Sniffer

composer check-style


Create a database, default configure yii2_basic_start_test in app/config/test-local.php

$config = [
    'components' => [
        'db' => [
            'dsn' => 'mysql:host=localhost;dbname=yii2_basic_start_test',

Apply migration:

composer migrate-test-up

Run in console

composer build
composer test


The BSD License (BSD). Please see License File for more information.