kartik-v/yii2-helpers A collection of useful helper functions for Yii Framework 2.0



Latest Stable Version License Total Downloads Monthly Downloads Daily Downloads

This extension is a collection of useful helper functions for Yii Framework 2.0.

Html Class


This class extends the Yii Html Helper to incorporate additional HTML markup functionality and features available in Bootstrap 3.0. The helper functions available in this class are:

  • Icon
  • Label
  • Badge
  • Page Header
  • Well
  • Close Button
  • Caret
  • Jumbotron
  • Abbreviation
  • Blockquote
  • Address
  • List Group
  • Panel
  • Media
  • Media List
  • Checkbox Button Group
  • Radio Button Group

Enum Class


This class extends the Yii Inflector Helper with more utility functions for Yii developers. The helper functions available in this class are:

  • Is Empty
  • In Array
  • Properize
  • Time Elapsed
  • Time To String
  • Time Remaining
  • Format Bytes
  • Number to Words
  • Year List
  • Month List
  • Day List
  • Date List
  • Time List
  • Boolean List
  • Get PHP Data Type
  • Array to HTML Table
  • IP Address


You can see a demonstration here on usage of these functions with documentation and examples.


The preferred way to install this extension is through composer.

Note: Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

Either run

$ php composer.phar require kartik-v/yii2-helpers "dev-master"

or add

"kartik-v/yii2-helpers": "dev-master"

to the require section of your composer.json file.


// add this to your code to use these classes
use kartik\helpers\Html;
use kartik\helpers\Enum;

// examples of usage
echo Html::icon('cloud');
echo Enum::properize('Chris');


yii2-helpers is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.


Change Log: yii2-helpers

Version 1.3.6

Date: 26-Nov-2016

  • (enh #33): Update Italian Translations.
  • (enh #35): Add Slovak Translations.
  • (enh #36): Update Russian Translations.
  • (enh #37): Update Finnish Translations.
  • (bug #38): Fix buttonGroup item parsing when set as Closure.
  • Update message config to include all default standard translation files.
  • Add github contribution and issue/PR logging templates.
  • Add branch alias for dev-master latest release.
  • Update PHP documentation for all classes in the extension.

Version 1.3.4

Date: 12-Dec-2015

  • (enh #27): Add Ukranian Translations.
  • (enh #28): Add Italian Translations.
  • (enh #29): Code style and formatting enhancements.

Version 1.3.3

Date: 22-Oct-2015

  • (enh #25): Fix russian traslation for "a moment ago"
  • (enh #26): Add functionality for Bootstrap Checkbox Button Group and Radio Button Group. New additions:
    • checkboxButtonGroup
    • radioButtonGroup
    • activeCheckboxButtonGroup
    • activeRadioButtonGroup

Version 1.3.2

Date: 09-Sep-2015

  • (enh #24): New timeInterval method in addition to timeElapsed.

Version 1.3.1

Date: 15-Jun-2015

  • (enh #15): Initialize i18N for getBrowser method.
  • (enh #16): Add Russian translation messages.
  • (enh #17, #18): Update Russian translation messages.
  • (enh #19): Add Portuguese Brazilian translation messages.
  • (bug #21): Remove duplicate browsers in list.
  • (enh #22): Add Spanish translations.

Version 1.3.0

Date: 23-Jan-2015

  • (enh #7): Implement translations.
  • (enh #8): Convert days, months, ones, tens, triplets to static methods
  • (enh #9): Add/Enhance new methods for dayList, monthList and dateList.
  • (enh #10): Enhance timeList method to include ranges and intervals.
  • (enh #11): Add French Translations and fix genCalList.
  • (enh #12): Completed French Translations.

Version 1.2.0

Date: 10-Nov-2014

  • Set release to stable

Version 1.1.0

Date: 12-Aug-2014

  • added inArray helper method - much faster than the inbuilt PHP in_array method
  • updated documentation for newer methods
  • PSR4 alias change

Version 1.0.0

Date: 01-Mar-2014

Initial release


GitHub Stars
GitHub Forks



v1.3.6 is the latest of 10 releases

BSD-3-Clause license
80 github stars & 45 github forks
846 downloads in the last day
18829 downloads in the last 30 days
414512 total downloads