Skip to content

roxblnfk/yii-demo

 
 

Yii Framework

Yii Framework Demo Project


[Yii Framework] is a modern framework designed to be a solid foundation for your PHP application.

It's intended to show and test all Yii features.

Latest Stable Version Total Downloads build Code Coverage static analysis type-coverage

Installation

You'll need at least PHP 7.4.

  1. Clone this repository.
  2. Configure config/params.php. You can skip this step.
  3. Run composer install in project root directory.
  4. Run ./vendor/bin/yii serve or start your web-server setting up public directory as webroot.
  5. Go to index page. Cycle ORM will create tables, indexes and relations automatically in the configured DB. If you want to disable this behavior then comment out line with Generator\SyncTables::class in the config/params.php. In this case you should create migrations to sync changes of entities with DB.
  6. Run ./vendor/bin/yii fixture/add 20 to create some random data.

Console

Console works out of the box and could be executed with ./vendor/bin/yii.

Some commands:

user/create <login> <password>
fixture/add [count]

In order to register your own commands, add them to console/params.php, consolecommands section.

Web application

In order to run web application either built-in web server could be used by running ./vendor/bin/yii serve or a real web server could be pointed to /public/index.php.

More routes could be added by editing src/Factory/AppRouterFactory.

Testing

The template comes with ready to use Codeception configuration. In order to execute tests run:

composer run serve > ./runtime/yii.log 2>&1 &
vendor/bin/codecept run

Static analysis

The code is statically analyzed with Psalm. To run static analysis:

./vendor/bin/psalm

Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack

License

The Yii Framework Demo Project is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.

Maintained by Yii Software.

Releases

No releases published

Packages

No packages published

Languages

  • PHP 98.8%
  • JavaScript 1.1%
  • CSS 0.1%