Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7904391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:02:32+00:00 2026-06-03T10:02:32+00:00

Where is the best place to create a class that contain all the application

  • 0

Where is the best place to create a class that contain all the application constant variables ?

is it :
– Bootstrap
– In the Application Common library

for example :
1- When i retrieve an image name from a database if this record doesnt have an image , i want to put a default value somewhere so i can use it in my models

** a constants that i use in all my application so if i change it , i dont want to go back to all in my code and change it everywhere

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:02:34+00:00Added an answer on June 3, 2026 at 10:02 am

    application.ini is the best place for example define some constant there

    constants.PUBLIC_PATH =  APPLICATION_PATH "/../public/"
    constants.THEME = blue
    

    Then in your bootstrap do

    protected function setConstants($constants)
    {
        foreach($constants as $name => $value)
        {
             if(!defined($name))
                define($name, $value);
        }
    
    }
    

    ZF take ‘constants’ from config and call setConstants method in your bootstrap passing all lines prefixed by constants hence its an array .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the best place in servlet for Hibernate code that returns HibernateSessionFactory ?
I've been told that it's best to place Javascript code in a separate file
I am trying to work out the best way to design a class that
I'm designing a re-usable class library that contains 2 assemblies (amongst others) named core.xml.dll
I try to create a plugin for personal use, that will place clouds in
I'm building an application that is multi-lingual, multi-timezoned and n-tier. All dates are stored
Where is the best place to implement caching in a web based app? At
I was wondering where is the best place to initialize members of the singleton
Is there a consensus about the best place to put Python unittests? Should the
Is the AfterSelected event the best place to respond to a click on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.