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 6965481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:04:01+00:00 2026-05-27T16:04:01+00:00

I have 50 controllers, and 90 Models. Everywhere i was using/repeating same words ‘login’

  • 0

I have 50 controllers, and 90 Models. Everywhere i was using/repeating same words ‘login’ and ‘success’. I want to make one global constant so that i can access from anywhere in my controllers and models. How or where do you declare this following 2 line.

Try to put this somewhere to have global access:

defined('MYFIXED_WORD_SUCCESS')
    || define('MYFIXED_WORD_SUCCESS', "success");
defined('MYFIXED_WORD_LOGIN')
    || define('MYFIXED_WORD_SUCCESS', "login");

Example of repeating:

if (count($result) > 0) 
{
  $return = array(
        'flag'  => 'login',  // replace it with MYFIXED_WORD_
        'result'=> 'success',// replace it with MYFIXED_WORD_
        'extra' => array(group'=>$rec->group,));
  • 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-05-27T16:04:02+00:00Added an answer on May 27, 2026 at 4:04 pm

    Anything you include or set in bootstrap.php should be available from anywhere in your application. But have a look at Zend_Translate since it does pretty much what you want but in a organised way.
    Alternatively you could set it in application.ini and get to it thru Zend_Config.

    You “could” put it in /public/index.php but in my opinion its not the place to put such thing. Imagine when you have thousands of const like that how it would polute a file that basically never should change.

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

Sidebar

Related Questions

I have an engine which defines some models and controllers. I want to be
I have 3 controllers doing exactly the same, calling the same models and views.
Generally, MVC frameeworks have a structure that looks something like: /models /views /controllers /utils
I have a general question about rails controllers/models: I have a model Providers, that
I have a codeigniter project structured as so: httpdocs/ /application/ /ggg/ config/ controllers/ models/
I've obtained a project that have controllers (minimal code only) and models, but the
I have a Rails application with several models-views-controllers which have some similar characteristics, for
Rails loads controllers, helpers and models on each request. My controllers have a bunch
We are building an app using the MVVM pattern, we have controllers that wire
I have 2 controllers: Projects and Users . Both models have no relation at

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.