From f90a610e1a531d1b8057215ffc69e891f136f414 Mon Sep 17 00:00:00 2001 From: Klimov Paul Date: Fri, 29 May 2015 14:28:09 +0300 Subject: [PATCH] Docs about `yii\bootstrap\Html` added --- Html.php | 2 +- docs/guide/README.md | 1 + docs/guide/helper-html.md | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 docs/guide/helper-html.md diff --git a/Html.php b/Html.php index a2c87e6..95f2e25 100644 --- a/Html.php +++ b/Html.php @@ -8,7 +8,7 @@ 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. * * Attention: do not confuse [[\yii\bootstrap\Html]] and [[\yii\helpers\Html]], be careful in which class diff --git a/docs/guide/README.md b/docs/guide/README.md index b6b25a2..ba5bebe 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -20,6 +20,7 @@ Usage ----- * [Yii widgets](usage-widgets.md) +* [Html helper](helper-html.md) Additional topics ----------------- diff --git a/docs/guide/helper-html.md b/docs/guide/helper-html.md new file mode 100644 index 0000000..cd8d116 --- /dev/null +++ b/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 + + 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. \ No newline at end of file