Skip to content

Commit

Permalink
Merge branch '1.1.x'
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGELOG.md
  • Loading branch information
stof committed May 17, 2012
2 parents 1f27b31 + 9d2d3ce commit 436508f
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
Expand Up @@ -4,6 +4,10 @@
Instead of storing the elements with the label as key and the uri as value
the array now stores an array of array elements with 3 keys: `label`, `uri` and `item`.

## 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 @@ -1140,6 +1136,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 436508f

Please sign in to comment.