PHP Classes

YII2 Framework PHP Init: Create a project based on the YII2 from template

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 33 All time: 11,097 This week: 52Up
Version License PHP version Categories
bassic 1.0.0Freeware5PHP 5, Libraries, Project Management
Description 

Author

This package can create a project based on the YII2 from the template.

It provides a service that integrates with PHP Composer to create a PHP application project based on the Yii 2 framework.

The package service can read configuration values for configuration scripts and generate a directory structure for a basic project that any developer can use to develop their application.

Innovation Award
PHP Programming Innovation award nominee
September 2021
Number 8
YII2 is a framework used by many PHP developers to create applications using a base of components included with the framework.

You can create applications following a pattern to start quickly.

You can use this package to create projects based on the YII2 framework that uses a template to follow the application pattern.

This way, you can start a YII2 application project very quickly.

Manuel Lemos
Picture of Uldis Nelsons
Name: Uldis Nelsons <contact>
Classes: 19 packages by
Country: Latvia Latvia
Innovation award
Innovation award
Nominee: 12x

Winner: 2x

 

Documentation

Yii 2 Basic Project Template

Yii 2 Basic Project Template is a skeleton Yii 2 application best for rapidly creating small projects.

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

Latest Stable Version Total Downloads Build Status

DIRECTORY STRUCTURE

  assets/             contains assets definition
  commands/           contains console commands (controllers)
  config/             contains application configurations
  controllers/        contains Web controller classes
  mail/               contains view files for e-mails
  models/             contains model classes
  runtime/            contains files generated during runtime
  tests/              contains various tests for the basic application
  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 project template that your Web server supports PHP 5.4.0.

INSTALLATION

Install from an Archive File

Extract the archive file downloaded from yiiframework.com to a directory named basic that is directly under the Web root.

Set cookie validation key in config/web.php file to some random secret string:

'request' => [
    // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
    'cookieValidationKey' => '<secret random string goes here>',
],

You can then access the application through the following URL:

http://localhost/basic/web/

Install via Composer

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

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

php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic

Now you should be able to access the application through the following URL, assuming basic is the directory directly under the Web root.

http://localhost/basic/web/

CONFIGURATION

Database

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

return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=yii2basic',
    '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. - Refer to the README in the tests directory for information specific to basic application tests.


  Files folder image Files (92)  
File Role Description
Files folder imageassets (1 file)
Files folder imagecommands (1 file)
Files folder imageconfig (4 files)
Files folder imagecontrollers (3 files, 2 directories)
Files folder imagegii (4 files)
Files folder imagemail (1 directory)
Files folder imagemessages (1 directory)
Files folder imagemigrations (1 file)
Files folder imagemodels (9 files, 1 directory)
Files folder imagetests (2 files, 1 directory)
Files folder imageviews (4 directories)
Files folder imageweb (4 files, 1 directory)
Accessible without login Plain text file .bowerrc Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file requirements.php Example Example script
Accessible without login Plain text file yii Example Example script
Accessible without login Plain text file yii.bat Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:33
This week:0
All time:11,097
This week:52Up