What are Yii helpers?

Member

by sidney , in category: Technology , 3 years ago

What are Yii helpers?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by melvina , 3 years ago

Helpers are static classes in Yii that simplify common coding tasks, such as string or array manipulations, HTML code generation, and so on.In Yii all helpers are kept under yii\helpers namespace.

You use a helper class in Yii by directly calling one of its static methods, like the following:

use yii\helpers\Html;

echo Html::encode('Test > test');