What are Yii helpers?

Member

sidney

by sidney , in category: Technology , 2 months ago

What are Yii helpers?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by melvina , 2 months 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');