From 1c26ddeebdb95c48387cd3f6bf938133a5bb9bf0 Mon Sep 17 00:00:00 2001 From: Christoph Erdmann Date: Thu, 10 Mar 2016 21:33:57 +0100 Subject: [PATCH] fixed multiple MaterializeWidgetTrait usage in Navbar/BaseWidget, PHPDoc update NavBar, update README --- README.md | 20 ++++++++--------- composer.json | 2 +- src/widgets/Nav.php | 50 +++++++++--------------------------------- src/widgets/NavBar.php | 4 +--- 4 files changed, 22 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index c9f3aef..db4a6a8 100755 --- a/README.md +++ b/README.md @@ -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 diff --git a/composer.json b/composer.json index 5c7382a..9b70c2a 100755 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "role": "Developer" } ], - "version": "1.0.2", + "version": "1.0.3", "require": { "php": ">=5.4.0", "yiisoft/yii2": "~2.0", diff --git a/src/widgets/Nav.php b/src/widgets/Nav.php index 5194776..9b8131e 100755 --- a/src/widgets/Nav.php +++ b/src/widgets/Nav.php @@ -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' => '#'], - * '
  • ', - * '', - * ['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 - * @since 2.0 + * Class Nav + * @package macgyer\yii2materializecss\widgets */ class Nav extends BaseWidget { @@ -69,20 +33,24 @@ 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. @@ -90,6 +58,7 @@ class Nav extends BaseWidget * @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`. @@ -97,10 +66,12 @@ class Nav extends BaseWidget * @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 `` will be used. To disable the caret, set this property to be an empty string. + * Defaults to `null` which means `arrow_drop_down` will be used. + * To disable the caret, set this property to be an empty string. */ public $dropDownCaret; @@ -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']); } /** diff --git a/src/widgets/NavBar.php b/src/widgets/NavBar.php index 0b06be6..e055b03 100755 --- a/src/widgets/NavBar.php +++ b/src/widgets/NavBar.php @@ -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: * @@ -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;