Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Erdmann committed Mar 10, 2016
2 parents 1057888 + 1c26dde commit 9aa5528
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 54 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,30 @@ public $depends = [

The following widgets are currently available:

* ActiveField
* ActiveForm
* Alert
* Breadcrumbs
* Button
* Chip
* DatePicker
* DetailView
* Dropdown
* Fixed Action Button
* GridView with ActionColumn
* Icon
* Modal
* Nav
* NavBar
* ActiveForm
* ActiveField
* SwitchButton
* GridView with ActionColumn
* DetailView
* Fixed Action Button
* DatePicker
* Modal
* Spinner
* Progress
* Spinner
* SwitchButton

These widgets are planned for development:

* Collapsible
* Collection
* Toast
* Collapsible

## Gii Support

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"role": "Developer"
}
],
"version": "1.0.2",
"version": "1.0.3",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "~2.0",
Expand Down
50 changes: 10 additions & 40 deletions src/widgets/Nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,8 @@
use yii\helpers\ArrayHelper;

/**
* Nav renders a nav HTML component.
*
* For example:
*
* ```php
* echo Nav::widget([
* 'items' => [
* [
* 'label' => 'Home',
* 'url' => ['site/index'],
* 'linkOptions' => [...],
* ],
* [
* 'label' => 'Dropdown',
* 'items' => [
* ['label' => 'Level 1 - Dropdown A', 'url' => '#'],
* '<li class="divider"></li>',
* '<li class="dropdown-header">Dropdown Header</li>',
* ['label' => 'Level 1 - Dropdown B', 'url' => '#'],
* ],
* ],
* [
* 'label' => 'Login',
* 'url' => ['site/login'],
* 'visible' => Yii::$app->user->isGuest
* ],
* ],
* 'options' => ['class' =>'nav-pills'], // set this to nav-tab to get tab-styled navigation
* ]);
* ```
*
* Note: Multilevel dropdowns beyond Level 1 are not supported in Bootstrap 3.
*
* @see http://getbootstrap.com/components/#dropdowns
* @see http://getbootstrap.com/components/#nav
*
* @author Antonio Ramirez <amigo.cobos@gmail.com>
* @since 2.0
* Class Nav
* @package macgyer\yii2materializecss\widgets
*/
class Nav extends BaseWidget
{
Expand All @@ -69,38 +33,45 @@ class Nav extends BaseWidget
* If a menu item is a string, it will be rendered directly without HTML encoding.
*/
public $items = [];

/**
* @var boolean whether the nav items labels should be HTML-encoded.
*/
public $encodeLabels = true;

/**
* @var boolean whether to automatically activate items according to whether their route setting
* matches the currently requested route.
* @see isItemActive
*/
public $activateItems = true;

/**
* @var boolean whether to activate parent menu items when one of the corresponding child menu items is active.
*/
public $activateParents = false;

/**
* @var string the route used to determine if a menu item is active or not.
* If not set, it will use the route of the current request.
* @see params
* @see isItemActive
*/
public $route;

/**
* @var array the parameters used to determine if a menu item is active or not.
* If not set, it will use `$_GET`.
* @see route
* @see isItemActive
*/
public $params;

/**
* @var string this property allows you to customize the HTML which is used to generate the drop down caret symbol,
* which is displayed next to the button text to indicate the drop down functionality.
* Defaults to `null` which means `<b class="caret"></b>` will be used. To disable the caret, set this property to be an empty string.
* Defaults to `null` which means `<i class="material-icons right">arrow_drop_down</i>` will be used.
* To disable the caret, set this property to be an empty string.
*/
public $dropDownCaret;

Expand All @@ -120,7 +91,6 @@ public function init()
if ($this->dropDownCaret === null) {
$this->dropDownCaret = Html::tag('i', 'arrow_drop_down', ['class' => 'material-icons right']);
}
// Html::addCssClass($this->options, ['widget' => 'nav']);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/widgets/NavBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
class NavBar extends BaseWidget
{
use MaterializeWidgetTrait;

/**
* @var array the HTML attributes for the widget container tag. The following special options are recognized:
*
Expand All @@ -38,7 +36,7 @@ class NavBar extends BaseWidget

/**
* @var string|boolean the text of the brand or false if it's not used. Note that this is not HTML-encoded.
* @see http://getbootstrap.com/components/#navbar
* @see http://materializecss.com/navbar.html
*/
public $brandLabel = false;

Expand Down

0 comments on commit 9aa5528

Please sign in to comment.