The TutsPlus.com site has continued their "Programming with Yii2" tutorial series with a new post introducing you to helper functions that come bundled with the framework. It also shows you how to create your own custom helper function, making it easier to perform common functions custom to your application.
In the Programming With Yii2 series, I'm guiding readers in use of the Yii2 Framework for PHP. In this tutorial, I'll provide a brief overview of helpers. In Yii, helpers are modules which group commonly useful libraries for string, file, image, URL and HTML management amongst other things, and they are easy to extend.I'll also share an example of creating a helper within Meeting Planner, the focus of our Envato Tuts+ startup series.
The tutorial then introduces you to (and links you to) the common helpers the framework comes bundled with including the ArrayHelper, FileHelper and Markdown helpers. The tutorial then covers two in a bit more detail, the ArrayHelper and HtmlPurifier helper, including some code examples for each. Finally it shows the creation of a custom helper with several custom functions and their use in a template.