[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] PHP flerdimensionel array "udfordring".



Jesper K. Pedersen wrote:
> I forbindelse med et lille projekt jeg er i gang med, har jeg
> forestillet mig at bruge et flerdimensionelt array til at styre
> menu-generering.
> I den forbindelse vil jeg gerne bruge "breadcrumb" princippet til at
> vise hvor jeg er i menuen.
> 
> Eksempel (kraftigt nedskåret fra det virkelige projekt) :
> 
> Forside | Filmoversigt | Udlån | Status | Om
> 
> 
> Hver kategori har så efter behov undermenuer. F.eks. er der under
> "Filmoversigt" følgende muligheder :
> 
> 	Nye film (1 måned)
> 	Nye film (3 måneder)
> 	Genrer
> 	...
> 
> Hvis man så klikker ind på "Filmoversigt" skal menuen se sådan her ud
> (breadcrumb princippet)
> 
> Forside | Filmoversigt | Nye film (1 måned) | Nye film (3 måneder) |
> Genrer | ...
> 
> Dvs. man viser hele stien til den menu man er i + "søskende" menuer.
> 
> Min tank er at bruge flerdimensionelle array's til at håndtere menuen.
> 
> Sådan her :
> 
> Array (
>   'text' => menutekst,
>   'page' => pageid,           (*note)
>   'style' => css_style_name,
>   'submenu' => array_af_menu_type
> )
> 
> 
> Dvs. mit eksempel ville se ud noget i stil med :
> 
> Array (
>   'text' => 'Forside',
>   'page' => 'forside',
>   'style' => 'menu',
>   'submenu' => Array (
>       Array( 'text => 'Filmoversigt',
>              'page' => 'film',
>              'style' => 'menu',
>              'submenu' => Array (
>                 Array( 'text' => 'Nye film (1 måned)',
>                        'page' => 'film_nye_1',
>                        'style' => 'menu',
>                        'submenu' => null),
>                 Array( 'text' => 'Nye film (3 måneder)',
>                        'page' => 'film_nye_3',
>                        'style' => 'menu',
>                        'submenu' => null)
> osv...
> 
> Mit problem er, hvordan jeg bygger stien til et element (dvs. finder
> "parent node").


Har du ikke denne når du har fundet "elementet", dvs. gemt sti undervejs
fra start-node/root ?
Eller hvordan finder du elementet?


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2010-05-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *