Yii 2.0: yii2-helpers

A collection of useful helper functions for Yii Framework 2.0.
33 followers

Introduction

This extension is a collection of useful helper functions (and classes) for Yii Framework 2.0. This extension works well together with the yii2-widgets extension.

Note:
No additional client assets (CSS/JS) are included with this extension. So there is no performance overhead due to additional Javascript or Cascading Style Sheets. The helper classes require the default bootstrap 3.0 assets that are automatically registered with your Yii 2.0 install.

Html Class

VIEW DEMO

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

  • CSS Style Helpers
    • addCssStyle
    • removeCssStyle
    • setCssStyle
    • getCssStyles
    • parseCssStyles
  • Icon
  • Label
  • Badge
  • Page Header
  • Well
  • Close Button
  • Caret
  • Jumbotron
  • Abbreviation
  • Blockquote
  • Address
  • List Group
  • Panel
  • Media
  • Media List

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
  • Properize
  • Time Elapsed
  • Format Bytes
  • Number to Words
  • Year List
  • Date List
  • Time List
  • Boolean List
  • Array to Table
  • IP Address
  • Browser Information

CHANGE LOG

Requirements

  • Yii 2.0 (*)
  • PHP 5.4
  • Twitter Bootstrap 3.0

Note: This extension mandatorily requires Yii Framework 2. The framework is under active development and the first stable release of Yii 2 is expected in early 2014.

Installation

The preferred way to install this extension is through composer.

Either run:

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

or add:

"kartik-v/yii2-helpers": "*"

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

Report

License

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

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet