What are Yii helpers?

Member

by sidney , in category: Technology , a year ago

What are Yii helpers?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by melvina , a year 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');