Skip to content
Yii 2 minimal application template
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
controllers Updated template to latest basic application changes Feb 13, 2019
models
runtime
vendor initial commit Feb 2, 2014
views Updated template to latest basic application changes Feb 13, 2019
web
.gitignore Update .gitignore for defaults Apr 26, 2015
LICENSE.md
README.md Updated template to latest basic application changes Feb 13, 2019
composer.json
requirements.php
yii
yii.bat Updated template to match the state of basic template of 2.0.0 releas… Nov 5, 2014

README.md

Yii 2 Minimal Application Template

Yii 2 Minimal Application Template is a skeleton Yii 2 application best for starting totally from scratch.

The template contains the basic features including user login/logout. It includes all commonly used configurations that would allow you to focus on adding new features to your application.

DIRECTORY STRUCTURE

  commands/           contains console commands (controllers)
  config/             contains application configurations
  controllers/        contains Web controller classes
  models/             contains model classes
  runtime/            contains files generated during runtime
  vendor/             contains dependent 3rd-party packages
  views/              contains view files for the Web application
  web/                contains the entry script and Web resources

REQUIREMENTS

The minimum requirement by this application template that your Web server supports PHP 5.4.0.

INSTALLATION

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

You can then install this application template using the following command:

composer create-project --prefer-dist --stability=dev samdark/yii2-minimal path/to/your/project

Now you should be able to access the application through the following URL, assuming your server webroot is pointed to project/web directory.

http://localhost/

CONFIGURATION

Database

Edit the file config/db.php with real data, for example:

return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=yii2minimal',
    'username' => 'root',
    'password' => '1234',
    'charset' => 'utf8',
];

NOTES:

  • Yii won't create the database for you, this has to be done manually before you can access it.
  • Check and edit the other files in the config/ directory to customize your application as required.
You can’t perform that action at this time.