kartik-v/yii2-helpers

A collection of useful helper functions for Yii Framework 2.0

Installs: 2 369 135

Dependents: 49

Suggesters: 0

Security: 0

Stars: 89

Watchers: 9

Forks: 44

Open Issues: 0

Type:yii2-extension

v1.3.9 2018-10-09 08:03 UTC

This package is auto-updated.

Last update: 2024-12-02 03:24:58 UTC


README

Krajee Logo
yii2-helpers Donate

Latest Stable Version Latest Unstable Version License Total Downloads Monthly Downloads Daily Downloads

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

Html Class

VIEW DEMO

This class extends the Yii Html Helper to incorporate additional HTML markup functionality and features available in Bootstrap 3.x / 4.x. 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

VIEW DEMO

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

Demo

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

Installation

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.

Usage

// 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');

License

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