Array with Statements

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arggg
    New Member
    • Mar 2008
    • 91

    Array with Statements

    What would be the proper way to set up an array of links based on access levels?

    [code=php]
    $adminlinks = array(
    "User" => "/admin/users",
    $func->iif($func->hasAccess(AL_E DIT_CONFIG),"Co nfig" => "/admin/config",""),
    "Template" => "/admin/template");
    [/code]
  • aktar
    New Member
    • Jul 2006
    • 105

    #2
    I wouldn't do it much differently. What you've dont seems good to me

    Comment

    • arggg
      New Member
      • Mar 2008
      • 91

      #3
      well with the iif statement it doesnt like the => or anything not in " "

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by arggg
        well with the iif statement it doesnt like the => or anything not in " "
        What would you be checking for in the IF statement?

        Comment

        • arggg
          New Member
          • Mar 2008
          • 91

          #5
          Originally posted by markusn00b
          What would you be checking for in the IF statement?
          The $func->iif checks if they are supposed to have access to that feature.

          Comment

          Working...