Difference between #34 and #35 of
Yii3 - How to start

Revision #35 has been created by rackycz rackycz on Oct 14, 2025, 8:16:59 AM with the memo:

edit
« previous (#34) next (#36) »

Changes

Title unchanged

Yii3 - How to start

Category unchanged

Tutorials

Yii version unchanged

3.0

Tags unchanged

Content changed

[...]
# Intro

In Yii3 it is not as easy to start as it was with Yii2. You have to install and configure basic things on your own. Yii3 uses the modern approach based on independent packages and dependency injection, but it makes it harder for newcomers. I am here to show all how I did it.

> All the code is available in my new [GitHub repository](https://github.com/rackycz/yii3api). I will be using it as a boiler-plate for my future projects so it should be always up
 -to -date and working. Instead of installing local WAMP- or XAMPP-server I will be using Docker. Do not forget about a modern IDE like PhpStorm, which comes bundled with all you will ever need.
[...]
To be honest, I still do not fully understand the real purpose of this situation.

## Hash annotations for class attributes
 
PHP 8 introduces annotations like this (not only for class attributes):
 
 
- `#[Column(type: 'primary')]`
 
- `#[Column(type: 'string(255)', nullable: true)]`
 
- `#[Entity(repository: UserRepository::class)]`
 
- `#[ManyToMany(target: Role::class, through: UserRole::class)]`
 
 
They should replace the original DocBlock annotatinos and provide more new functionalities.
 
 
Learn what they mean and how they are used by Yii3. To me this is a brand new topic as well.
 
 
 
# Yii3 - How to start

Yii3 offers more basic applications: Web, Console, API. I will be using the API application:
[...]
composer require yiisoft/db-mysql
composer require yiisoft/cache
composer require yiisoft/db-migration
 --dev
```

To run composer (or any other command inside your dockerized yii3 application) you have 4 options:
- Make:
The best solution is to prepend the composer commands with "make".
[...]
2 0
5 followers
Viewed: 42 299 times
Version: 3.0
Category: Tutorials
Tags:
Written by: rackycz rackycz
Last updated by: rackycz rackycz
Created on: Oct 8, 2025
Last updated: 2 months ago
Update Article

Revisions

View all history