From 06e41a8d1fcd860a9db610fae7cfe31ab778bd6d Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Mon, 23 Mar 2015 00:12:02 +0300 Subject: [PATCH] Moved docs from the guide, adjusted readme --- README.md | 2 -- docs/guide/README.md | 27 +++++++++++++++++++++++++++ docs/guide/basic-usage.md | 17 +++++++++++++++++ docs/guide/installation.md | 20 ++++++++++++++++++++ docs/guide/topics-less.md | 17 +++++++++++++++++ docs/guide/usage-widgets.md | 19 +++++++++++++++++++ 6 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 docs/guide/README.md create mode 100644 docs/guide/basic-usage.md create mode 100644 docs/guide/installation.md create mode 100644 docs/guide/topics-less.md create mode 100644 docs/guide/usage-widgets.md diff --git a/README.md b/README.md index 0e3be30..27cc5dc 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ This is the Twitter Bootstrap extension for Yii 2. It encapsulates [Bootstrap](h and plugins in terms of Yii widgets, and thus makes using Bootstrap components/plugins in Yii applications extremely easy. -This repository is a git submodule of . -Please submit issue reports and pull requests to the main repository. For license information check the [LICENSE](LICENSE.md)-file. Installation diff --git a/docs/guide/README.md b/docs/guide/README.md new file mode 100644 index 0000000..2169c1e --- /dev/null +++ b/docs/guide/README.md @@ -0,0 +1,27 @@ +MongoDb Extension for Yii 2 +=========================== + +Out of the box, Yii includes support for the [Bootstrap 3](http://getbootstrap.com/) markup and components framework +(also known as "Twitter Bootstrap"). Bootstrap is an excellent, responsive framework that can greatly speed up the +client-side of your development process. + +The core of Bootstrap is represented by two parts: + +- CSS basics, such as a grid layout system, typography, helper classes, and responsive utilities. +- Ready to use components, such as forms, menus, pagination, modal boxes, tabs etc. + +Getting Started +--------------- + +* [Installation](installation.md) +* [Basic Usage](basic-usage.md) + +Usage +----- + +* [Yii widgets](usage-widgets.md) + +Additional topics +----------------- + +* [Using the .less files of Bootstrap directly](topics-less.md) diff --git a/docs/guide/basic-usage.md b/docs/guide/basic-usage.md new file mode 100644 index 0000000..e95d42b --- /dev/null +++ b/docs/guide/basic-usage.md @@ -0,0 +1,17 @@ +Basic Usage +=========== + +Yii doesn't wrap the bootstrap basics into PHP code since HTML is very simple by itself in this case. You can find details +about using the basics at [bootstrap documentation website](http://getbootstrap.com/css/). Still Yii provides a +convenient way to include bootstrap assets in your pages with a single line added to `AppAsset.php` located in your +`@app/assets` directory: + +```php +public $depends = [ + 'yii\web\YiiAsset', + 'yii\bootstrap\BootstrapAsset', // this line +]; +``` + +Using bootstrap through Yii asset manager allows you to minimize its resources and combine with your own resources when +needed. diff --git a/docs/guide/installation.md b/docs/guide/installation.md new file mode 100644 index 0000000..e39f37d --- /dev/null +++ b/docs/guide/installation.md @@ -0,0 +1,20 @@ +Installation +============ + +## Getting Composer package + +The preferred way to install this extension is through [composer](http://getcomposer.org/download/). + +Either run + +``` +php composer.phar require --prefer-dist yiisoft/yii2-bootstrap +``` + +or add + +``` +"yiisoft/yii2-bootstrap": "~2.0.0" +``` + +to the require section of your `composer.json` file. diff --git a/docs/guide/topics-less.md b/docs/guide/topics-less.md new file mode 100644 index 0000000..b7522c9 --- /dev/null +++ b/docs/guide/topics-less.md @@ -0,0 +1,17 @@ +Using the .less files of Bootstrap directly +=========================================== + +If you want to include the [Bootstrap css directly in your less files](http://getbootstrap.com/getting-started/#customizing) +you may need to disable the original bootstrap css files to be loaded. +You can do this by setting the css property of the [[yii\bootstrap\BootstrapAsset|BootstrapAsset]] to be empty. +For this you need to configure the `assetManager` [application component](structure-application-components.md) as follows: + +```php + 'assetManager' => [ + 'bundles' => [ + 'yii\bootstrap\BootstrapAsset' => [ + 'css' => [], + ] + ] + ] +``` diff --git a/docs/guide/usage-widgets.md b/docs/guide/usage-widgets.md new file mode 100644 index 0000000..004a949 --- /dev/null +++ b/docs/guide/usage-widgets.md @@ -0,0 +1,19 @@ +Yii widgets +=========== + +Most complex bootstrap components are wrapped into Yii widgets to allow more robust syntax and integrate with +framework features. All widgets belong to `\yii\bootstrap` namespace: + +- [[yii\bootstrap\ActiveForm|ActiveForm]] +- [[yii\bootstrap\Alert|Alert]] +- [[yii\bootstrap\Button|Button]] +- [[yii\bootstrap\ButtonDropdown|ButtonDropdown]] +- [[yii\bootstrap\ButtonGroup|ButtonGroup]] +- [[yii\bootstrap\Carousel|Carousel]] +- [[yii\bootstrap\Collapse|Collapse]] +- [[yii\bootstrap\Dropdown|Dropdown]] +- [[yii\bootstrap\Modal|Modal]] +- [[yii\bootstrap\Nav|Nav]] +- [[yii\bootstrap\NavBar|NavBar]] +- [[yii\bootstrap\Progress|Progress]] +- [[yii\bootstrap\Tabs|Tabs]]