findBy(x) Using Zend_Navigation with custom route

Posted by Stephen on Stack Overflow See other posts from Stack Overflow or by Stephen
Published on 2012-11-17T22:56:31Z Indexed on 2012/11/17 22:59 UTC
Read the original article Hit count: 182

Filed under:
|
|

I am creating my navigation from a db generated array and defining which route to use for some of the uris. when I set the route i am no longer able to use findByUri() as the uri seems to be moved under the properties key

example array being used:

[id] => 7
[label] => Legal
[controller] => index
[uri] => /legal
[route] => cmsPage
[visible] => 1
[params] => Array
    (
         [first] => legal
    )

snippet of the output:

[_properties:protected] => Array
        (
        [uri] => /legal
        [created] => 2012-10-20 10:23:23
        )

When I don't define the route I am able to use findByUri() successfully.

currently I am looping through each to find the property that matches the request but it seems a long / wrong approach

Is there a way to search by the nested param - or am i doing something wrong with the setup (everything else behaves as expected)

© Stack Overflow or respective owner

Related posts about php

Related posts about zend-framework