How to create a new helper in Yii2 framework:

Create a new file “Utils.php” in “app-basic\helpers” or in other folder, location is up to you, but keep things organized!

In this helper we have 2 functions to display raw data.

Include this file in your entry script app-basic/web/index.php;

Use these helpers in your view files:

Yii2: create helper
Tagged on:     

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.