Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    922
    Thanks
    302
    Thanked 3 Times in 3 Posts

    Question Zend Framework: Declaring Constants

    Hi

    In Zend Framework, if I want to define a constant and want to access it anywhere throughout the project viz. Controllers, views and models, which is the best place to declare it?

    Any help is appreciated.


    Thanks

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    I don't know anything about the zend framework, but as soon as you've declared a constant with define (not with const which is namespace and class specific), that constant becomes global regardless of declared scope.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •