P
P
Peter2015-08-26 22:34:04
Zend Framework
Peter, 2015-08-26 22:34:04

How to split menu into custom selects in zf2?

There are a lot of pages that are registered in navigation:

'navigation' => array(
        'default' => array(
            array(
                'label' => 'Новости',
                'order' => 50,
                'route' => 'article',
                'resource' => 'Article\Controller\Article',
                'controller' => 'Article\Controller\Article',
                'action' => 'index',
                'params' => array('id' => null)
            ),
        ),
    ),

I display them in the menu something like this:
$iterator = new RecursiveIteratorIterator($this->container, RecursiveIteratorIterator::SELF_FIRST);
Next, I sort through the links, output a certain amount, and combine some into a drop-down.
There was a need to sort the links into thematic groups and combine them into dropdowns. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cat Anton, 2015-08-26
@27cm

If I understood correctly, then you can start by setting the links to classes corresponding to thematic groups.
framework.zend.com/manual/current/en/modules/zend....
From an array of one page it is difficult to understand what is there and how you have it. Is there some sort of page hierarchy?
Why are you iterating over the links yourself instead of using the view helper?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question