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 ¶
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 ¶
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 ¶
- 2014-03-07: Added array2table and getBrowser helper functions to Enum class.
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 ¶
- Report any issues on the project page
- Use the forum page for any discussions on this extension
License ¶
yii2-helpers is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.