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

Recommend this page to a friend!
  Info   View files Documentation   View files View files (92)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2021-09-10 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 17 All time: 10,417 This week: 194Up
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
Nominee
Vote
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: 13 packages by
Country: Latvia Latvia
Innovation award
Innovation award
Nominee: 8x

Winner: 2x

Details

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  
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

  Files folder image Files  /  assets  
File Role Description
  Plain text file AppAsset.php Class Class source

  Files folder image Files  /  commands  
File Role Description
  Plain text file HelloController.php Class Class source

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file console.php Aux. Auxiliary script
  Accessible without login Plain text file db.php Aux. Auxiliary script
  Accessible without login Plain text file params.php Aux. Auxiliary script
  Accessible without login Plain text file web.php Aux. Auxiliary script

  Files folder image Files  /  controllers  
File Role Description
Files folder imageapi (2 files)
Files folder imagebase (2 files)
  Plain text file SiteController.php Class Class source
  Plain text file TestContactsController.php Class Class source
  Plain text file TestController.php Class Class source

  Files folder image Files  /  controllers  /  api  
File Role Description
  Plain text file TestContactsController.php Class Class source
  Plain text file TestController.php Class Class source

  Files folder image Files  /  controllers  /  base  
File Role Description
  Plain text file TestContactsController.php Class Class source
  Plain text file TestController.php Class Class source

  Files folder image Files  /  gii  
File Role Description
  Accessible without login Plain text file TestContactsGiiantCRUD.json Data Auxiliary data
  Accessible without login Plain text file TestGiiantCRUD.json Data Auxiliary data
  Accessible without login Plain text file testGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file test_contactsGiiantModel.json Data Auxiliary data

  Files folder image Files  /  mail  
File Role Description
Files folder imagelayouts (1 file)

  Files folder image Files  /  mail  /  layouts  
File Role Description
  Accessible without login Plain text file html.php Example Example script

  Files folder image Files  /  messages  
File Role Description
Files folder imagefor-translation (2 files)

  Files folder image Files  /  messages  /  for-translation  
File Role Description
  Accessible without login Plain text file Test.php Aux. Auxiliary script
  Accessible without login Plain text file TestContacts.php Aux. Auxiliary script

  Files folder image Files  /  migrations  
File Role Description
  Plain text file m160607_200101_Test_create.php Class Class source

  Files folder image Files  /  models  
File Role Description
Files folder imagebase (2 files)
  Plain text file ContactForm.php Class Class source
  Plain text file LoginForm.php Class Class source
  Plain text file Test.php Class Class source
  Plain text file TestContacts.php Class Class source
  Plain text file testContactsQuery.php Class Class source
  Plain text file TestContactsSearch.php Class Class source
  Plain text file testQuery.php Class Class source
  Plain text file TestSearch.php Class Class source
  Plain text file User.php Class Class source

  Files folder image Files  /  models  /  base  
File Role Description
  Plain text file Test.php Class Class source
  Plain text file TestContacts.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imagecodeception (4 files, 6 directories)
  Accessible without login Plain text file codeception.yml Data Auxiliary data
  Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  tests  /  codeception  
File Role Description
Files folder imageacceptance (5 files)
Files folder imagebin (3 files)
Files folder imageconfig (4 files)
Files folder imagefunctional (5 files)
Files folder imageunit (1 file, 1 directory)
Files folder image_pages (3 files)
  Accessible without login Plain text file acceptance.suite.yml Data Auxiliary data
  Accessible without login Plain text file functional.suite.yml Data Auxiliary data
  Accessible without login Plain text file unit.suite.yml Data Auxiliary data
  Accessible without login Plain text file _bootstrap.php Aux. Auxiliary script

  Files folder image Files  /  tests  /  codeception  /  acceptance  
File Role Description
  Accessible without login Plain text file AboutCept.php Example Example script
  Accessible without login Plain text file ContactCept.php Example Example script
  Accessible without login Plain text file HomeCept.php Example Example script
  Accessible without login Plain text file LoginCept.php Example Example script
  Accessible without login Plain text file _bootstrap.php Example Example script

  Files folder image Files  /  tests  /  codeception  /  bin  
File Role Description
  Accessible without login Plain text file yii Example Example script
  Accessible without login Plain text file yii.bat Data Auxiliary data
  Accessible without login Plain text file _bootstrap.php Aux. Auxiliary script

  Files folder image Files  /  tests  /  codeception  /  config  
File Role Description
  Accessible without login Plain text file acceptance.php Aux. Auxiliary script
  Accessible without login Plain text file config.php Aux. Auxiliary script
  Accessible without login Plain text file functional.php Aux. Auxiliary script
  Accessible without login Plain text file unit.php Aux. Auxiliary script

  Files folder image Files  /  tests  /  codeception  /  functional  
File Role Description
  Accessible without login Plain text file AboutCept.php Example Example script
  Accessible without login Plain text file ContactCept.php Example Example script
  Accessible without login Plain text file HomeCept.php Example Example script
  Accessible without login Plain text file LoginCept.php Example Example script
  Accessible without login Plain text file _bootstrap.php Example Example script

  Files folder image Files  /  tests  /  codeception  /  unit  
File Role Description
Files folder imagemodels (3 files)
  Accessible without login Plain text file _bootstrap.php Aux. Auxiliary script

  Files folder image Files  /  tests  /  codeception  /  unit  /  models  
File Role Description
  Plain text file ContactFormTest.php Class Class source
  Plain text file LoginFormTest.php Class Class source
  Plain text file UserTest.php Class Class source

  Files folder image Files  /  tests  /  codeception  /  _pages  
File Role Description
  Plain text file AboutPage.php Class Class source
  Plain text file ContactPage.php Class Class source
  Plain text file LoginPage.php Class Class source

  Files folder image Files  /  views  
File Role Description
Files folder imagelayouts (1 file)
Files folder imagesite (5 files)
Files folder imagetest-contacts (6 files)
Files folder imagetest (6 files)

  Files folder image Files  /  views  /  layouts  
File Role Description
  Accessible without login Plain text file main.php Example Example script

  Files folder image Files  /  views  /  site  
File Role Description
  Accessible without login Plain text file about.php Example Example script
  Accessible without login Plain text file contact.php Example Example script
  Accessible without login Plain text file error.php Example Example script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file login.php Example Example script

  Files folder image Files  /  views  /  test-contacts  
File Role Description
  Accessible without login Plain text file create.php Example Example script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file update.php Example Example script
  Accessible without login Plain text file view.php Example Example script
  Accessible without login Plain text file _form.php Example Example script
  Accessible without login Plain text file _search.php Example Example script

  Files folder image Files  /  views  /  test  
File Role Description
  Accessible without login Plain text file create.php Example Example script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file update.php Example Example script
  Accessible without login Plain text file view.php Example Example script
  Accessible without login Plain text file _form.php Example Example script
  Accessible without login Plain text file _search.php Example Example script

  Files folder image Files  /  web  
File Role Description
Files folder imagecss (1 file)
  Accessible without login Image file favicon.ico Data Auxiliary data
  Accessible without login Plain text file index-test.php Example Example script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file robots.txt Doc. Documentation

  Files folder image Files  /  web  /  css  
File Role Description
  Accessible without login Plain text file site.css Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:17
This week:0
All time:10,417
This week:194Up
For more information send a message to info at phpclasses dot org.