Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TutsPlus.com:
Programming With Yii2: Helpers
Dec 27, 2016 @ 17:13:44

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.

tagged: programming series yii2 framework helpers custom tutorial

Link: https://code.tutsplus.com/tutorials/programming-with-yii2-helpers--cms-26889


Trending Topics: