tilhom/phonebook-yii2
Implementation of test task telephone directory using Yii 2, (*1)
Statement of work: In this work want to create the program phone book containing the following information: full name, date of birth, notes, phone (mobile, home)., (*2)
Features
- The application is able to perform a global search (in part of the name, telephone),
- CRUD,
- The user interface has two roles (user and aministrator),
- migrations,
- tests,
- RBAC,
- Dynamic Forms,
- Complex Forms,
- Karthik Gridview Expand Row,
- DatePicker widget.
REQUIREMENTS
The minimum requirement by this project template that your Web server supports PHP 5.4.0., (*3)
INSTALLATION
Install via Composer
If you do not have Composer, you may install it by following the instructions
at getcomposer.org., (*4)
You can then install this project template using the following command:, (*5)
php composer.phar global require "fxp/composer-asset-plugin:~1.0.0"
php composer.phar create-project --prefer-dist --stability=dev tilhom/phonebook-yii2 phonebook
CONFIGURATION
Database
Create the file config/db.php
with real data, for example:, (*6)
return [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=yii2basic',
'username' => 'root',
'password' => '1234',
'charset' => 'utf8',
];
NOTE: Yii won't create the database for you, this has to be done manually before you can access it., (*7)
Also check and edit the other files in the config/
directory to customize your application., (*8)
After the establishment of the project in the working directory, you must run the migration:, (*9)
yii migration
After migration, use the following administrator and user accounts:, (*10)
Login: admin
Password: admin121345
Login: user1
Password: 123456
To start the telephone book is in the working directory of the application, type the command:, (*11)
php -S localhost:8080 -t web
Now you should be able to access the application through the following URL, (*12)
http://localhost:8080
Testing
To create and verify the tests you must switch to directory test/codeception and correct url in the configuration file codeception.yml, (*13)
Then return to directory tests to build a test environment using the command:, (*14)
../vendor/bin/codecept build
Make migration with command:, (*15)
codeception/bin/yii migrate
For example, to run basic template acceptance tests type command:, (*16)
../vendor/bin/codecept run acceptance
Please refer to instructions provided in app/tests/README.md, (*17)