Skip to content

Latest commit

 

History

History
82 lines (63 loc) · 2.44 KB

README.md

File metadata and controls

82 lines (63 loc) · 2.44 KB

yii2-helpers

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

NOTE: This extension depends on the yiisoft/yii2-bootstrap extension. Check the composer.json for this extension's requirements and dependencies. Note: Yii 2 framework is still in active development, and until a fully stable Yii2 release, your core yii2-bootstrap packages (and its dependencies) may be updated when you install or update this extension. You may need to lock your composer package versions for your specific app, and test for extension break if you do not wish to auto update dependencies.

Html Class

VIEW DEMO

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

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
  • 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.

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.