variarty/yii-template

There is no license information available for the latest version (1.0.0) of this package.

Another Yii2 template

1.0.0 2018-01-13 08:44 UTC

This package is not auto-updated.

Last update: 2024-11-07 00:16:44 UTC


README

This Project Template is another skeleton Yii 2 for creating projects. The template contains the basic features including user sign in/up and a password recovery page.

Latest Stable Version Total Downloads

DIRECTORY STRUCTURE

app
    assets/              contains application assets such as JavaScript and CSS
    config/              contains application configurations
    controllers/         contains Web controller classes
    forms/               contains Web form classes
    messages/            contains message translation
    runtime/             contains files generated during runtime
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
    widgets/             contains GUI widgets
common
    config/              contains shared configurations
    entities/            contains etities classes
    jobs/                contains jobs (tasks)
    mail/                contains view files for e-mails
    messages/            contains shared messages (core)
    migrations/          contains database migrations
    repositories/        contains classes for working with the database
    services/            contains services classes
console
    commands/            contains console controllers
    config/              contains console configurations
    runtime/             contains files generated during runtime
tests
    runtime/             contains files generated during runtime
    unit/                contains unit tests
vendor/                  contains dependent 3rd-party packages

REQUIREMENTS

  • PHP >= 7.0
  • PHPUnit >= 6.0 (for tests running only)
  • Bower
  • Npm
  • Gulp

INSTALLATION

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 create-project --prefer-dist variarty/yii-tempate app
cd app
npm install
bower install

Web resources building

Gulp is used to build web resources (css, js, etc.). Gulp has several tasks:

gulp                help task (get available tasks with description)
gulp less           transform app less to css
gulp js             copy app JS to dist directory
gulp bootstrap      build Twitter Bootstrap with custom overrides
gulp build          run `less`, `js`, `bootstrap` tasks
gulp watch          watch resources src directory and run 'build' task on change

Phing usage

If you have Phing you can run phing in your application directory. Phing will run the commands:

composer install
npm install
bower install
gulp build

TESTING

Tests are located in tests directory. They are developed with PHPUnit. Tests can be executed by running

phpunit

The command above will execute unit tests. Now, unit tests are testing only entities.