O'Reilly logo

Mastering Yii by Charles R. Portwood II

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Helpers

Yii2 has several built-in helper classes to streamline common coding tasks, such as HTML, array, and JSON manipulation. These helper functions take the form of static classes (which means that they should be called statically rather than being instantiated) and live underneath the \yii\helpers namespace. In this section, we'll go over several of the more common helpers.

Tip

Comprehensive documentation for all helpers Yii2 supports can be found on the Yii2 API documentation page underneath the helpers section at http://www.yiiframework.com/doc-2.0/.

The URL helper

The first helper commonly used in Yii2 is the URL helper. The URL helper helps us retrieve specific URLs, such as the base and home URL, and generate URL routes to specific paths. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required