Skip to content

Commit

Permalink
Added the children attributes and the extras in the array export
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed May 17, 2012
1 parent eedc1a5 commit 9d2d3ce
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.1 (2012-05-17)

* Added the children attributes and the extras in the array export

## 1.1.0 (2012-05-17)

* Marked `Knp\Menu\ItemInterface::getCurrentItem` as deprecated
Expand Down
6 changes: 2 additions & 4 deletions src/Knp/Menu/MenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

namespace Knp\Menu;

use Knp\Menu\Iterator\ItemIterator;
use Knp\Menu\Renderer\RendererInterface;
use Knp\Menu\Renderer\ListRenderer;

/**
* Default implementation of the ItemInterface
*/
Expand Down Expand Up @@ -1090,6 +1086,8 @@ public function toArray($depth = null)
'attributes' => $this->attributes,
'labelAttributes' => $this->labelAttributes,
'linkAttributes' => $this->linkAttributes,
'childrenAttributes' => $this->childrenAttributes,
'extras' => $this->extras,
'display' => $this->display,
'displayChildren' => $this->displayChildren,
);
Expand Down
16 changes: 16 additions & 0 deletions tests/Knp/Menu/Tests/MenuItemGetterSetterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ public function testToArrayWithChildren()
'attributes' => array(),
'labelAttributes' => array(),
'linkAttributes' => array(),
'childrenAttributes' => array(),
'extras' => array(),
'display' => true,
'displayChildren' => true,
'children' => array(
Expand All @@ -221,6 +223,8 @@ public function testToArrayWithChildren()
'attributes' => array(),
'labelAttributes' => array(),
'linkAttributes' => array('title' => 'php'),
'childrenAttributes' => array(),
'extras' => array(),
'display' => false,
'displayChildren' => true,
'children' => array(
Expand All @@ -231,6 +235,8 @@ public function testToArrayWithChildren()
'attributes' => array(),
'labelAttributes' => array(),
'linkAttributes' => array(),
'childrenAttributes' => array(),
'extras' => array(),
'display' => true,
'displayChildren' => true,
'children' => array(),
Expand All @@ -244,6 +250,8 @@ public function testToArrayWithChildren()
'attributes' => array('class' => 'leaf'),
'labelAttributes' => array('class' => 'center'),
'linkAttributes' => array(),
'childrenAttributes' => array(),
'extras' => array(),
'display' => true,
'displayChildren' => false,
'children' => array(),
Expand All @@ -270,6 +278,8 @@ public function testToArrayWithLimitedChildren()
'attributes' => array(),
'labelAttributes' => array(),
'linkAttributes' => array(),
'childrenAttributes' => array(),
'extras' => array(),
'display' => true,
'displayChildren' => true,
'children' => array(
Expand All @@ -280,6 +290,8 @@ public function testToArrayWithLimitedChildren()
'attributes' => array(),
'labelAttributes' => array(),
'linkAttributes' => array('title' => 'php'),
'childrenAttributes' => array(),
'extras' => array(),
'display' => false,
'displayChildren' => true,
),
Expand All @@ -290,6 +302,8 @@ public function testToArrayWithLimitedChildren()
'attributes' => array('class' => 'leaf'),
'labelAttributes' => array('class' => 'center'),
'linkAttributes' => array(),
'childrenAttributes' => array(),
'extras' => array(),
'display' => true,
'displayChildren' => false,
),
Expand All @@ -313,6 +327,8 @@ public function testToArrayWithoutChildren()
'attributes' => array(),
'labelAttributes' => array(),
'linkAttributes' => array(),
'childrenAttributes' => array(),
'extras' => array(),
'display' => true,
'displayChildren' => true,
),
Expand Down

0 comments on commit 9d2d3ce

Please sign in to comment.