Skip to content

Files

Latest commit

 

History

History

blog

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

  1. Clone this repository.
  2. Run command in your project root directory.
composer install
  1. Run ./yii serve (on Windows yii serve). The application will be started on http://localhost:8080/.
./yii serve 
  1. Go to the index page. Cycle ORM will create tables, indexes and relations automatically in the configured DB for you. If you want to disable this behavior then comment out the line with the Generator\SyncTables::class in the config/packges/yiisoft/yii-cycle/params.php. In this case you should create migrations to sync changes that you have made to entities with the DB.
  2. Run command to create some random data.
./yii fixture/add 20

Console

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

Some commands:

./yii user/create login password
./yii fixture/add 10

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

Web application

In order to run the web application, you can either use the built-in web server by running

./yii serve

or you could use a real web server by pointing it to /public/index.php.

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

Testing

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

composer run serve 127.0.0.1:8080 > ./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.