Browse Source

Docs about `yii\bootstrap\Html` added

tags/2.0.5
Klimov Paul 10 years ago
parent
commit
f90a610e1a
  1. 2
      Html.php
  2. 1
      docs/guide/README.md
  3. 30
      docs/guide/helper-html.md

2
Html.php

@ -8,7 +8,7 @@
namespace yii\bootstrap; namespace yii\bootstrap;
/** /**
* Html is an enhanced version of [[\yii\helpers\Html]] helper class dedicated to Bootstrap needs. * Html is an enhanced version of [[\yii\helpers\Html]] helper class dedicated to the Bootstrap needs.
* This class inherits all functionality available at [[\yii\helpers\Html]] and can be used as substitute. * This class inherits all functionality available at [[\yii\helpers\Html]] and can be used as substitute.
* *
* Attention: do not confuse [[\yii\bootstrap\Html]] and [[\yii\helpers\Html]], be careful in which class * Attention: do not confuse [[\yii\bootstrap\Html]] and [[\yii\helpers\Html]], be careful in which class

1
docs/guide/README.md

@ -20,6 +20,7 @@ Usage
----- -----
* [Yii widgets](usage-widgets.md) * [Yii widgets](usage-widgets.md)
* [Html helper](helper-html.md)
Additional topics Additional topics
----------------- -----------------

30
docs/guide/helper-html.md

@ -0,0 +1,30 @@
Html helper
===========
Bootstrap introduces many consistent HTML constructions and skeletons, which allow creating different visual effects.
Only the most complex of them are covered by widgets provided with this extension. The rest should be composed manually
using direct HTML composition.
However, several special Bootstrap markup cases are covered by [[\yii\bootstrap\Html]] helper.
[[\yii\bootstrap\Html]] is an enhanced version of the regular [[\yii\helpers\Html]] dedicated to the Bootstrap needs.
It provides several useful methods:
- `icon()` - allows rendering of Glyphicon icons
- `staticControl()` - allows rendering of form "static controls"
[[\yii\bootstrap\Html]] inherits all functionality available at [[\yii\helpers\Html]] and can be used as substitute,
so you don't need them both inside your view files.
For example:
```php
<?php
use yii\bootstrap\Html;
?>
<?= Button::widget([
'label' => Html::icon('approve') . Html::encode('Save & apply'),
'encodeLabel' => false,
'options' => ['class' => 'btn-primary'],
]); ?>
```
> Attention: do not confuse [[\yii\bootstrap\Html]] and [[\yii\helpers\Html]], be careful in which class
you are using inside your views.
Loading…
Cancel
Save