Zend, Global variable in Application.ini?

后端 未结 6 1366
失恋的感觉
失恋的感觉 2021-02-04 14:24

I have a question as I need to have a global static variable and I have question is any possibility to add it to the application.ini file, how to do it?

Or I have to:

6条回答
  •  名媛妹妹
    2021-02-04 15:03

    I have a series of constants with the following naming convention in application.ini:

    system.image_path  = "/assets/images"
    system.custom_path = "/assets/custom"
    system.cdn_URL     = "http://cdnurl.com"  
    

    And I just reference them in my code as if they were PHP constants:

    SYSTEM_IMAGE_PATH
    SYSTEM_CUSTOM_PATH
    SYSTEM_CDN_URL
    

提交回复
热议问题