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”

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”