Customizing routes with urlManager rules in Yii2

By default, a URL in Yii Framework is of the form example.com/index.php?r=controller/action, where ‘r’ represents a route. When the application receives the route, it first analyses it and then creates an instance of a controller action according to the route’s name. If a controller or an action is not found, the application will throw NotFoundException.
Continue reading “Customizing routes with urlManager rules in Yii2”

Why use strict typing mode of PHP7?

All modern programming languages can be divided into two groups according to their data type declaration: dynamic and static. The difference between them is, that the type of data in statically typed languages like Java or C++ can be distinguished at compile time, while the type of variables assigned dynamically may not always be correctly specified.

Continue reading “Why use strict typing mode of PHP7?”

Where to use Behaviors in Yii2

Behaviors are one of the specific concepts of Yii Framework, which can help you to extend existing functionality of a component without affecting its inheritance properties. You can easily attach behaviors to a class and gain access to all of its properties and methods. This may help to avoid a duplication of code and make it look cleaner and elegant.

Continue reading “Where to use Behaviors in Yii2”