Questions tagged [global-scope]

Global scope defines a namespace that is fully accessible in the entire program or script.

Global scope defines a namespace that is fully accessible in the entire program or script. Variables, classes and objects that are defined in the global scope can usually be accessed anywhere in the code, and are often referred to as global variables.

108 questions
-1
votes
1 answer

yii - variable available to each controller

I am new to yii. I am using more than 1 controller in my website and each controller has few actions. I want to use some variables across each controller (Value of variable will be fixed, I need some constants for a formula). Whats the best place…
Jashwant
  • 28,410
  • 16
  • 70
  • 105
-2
votes
1 answer

Php __autoload() function, how to use

I just started learning PHP from a book. In the OOP chapter there is an explanation of the __autoload() function for "Automatically Load Class Files" but my book doesn't say where I should declare this function. I tried to Google it and in the PHP…
Carl
  • 33
  • 9
-3
votes
1 answer

Why can't I access global-scope variables from one file in another file?

Say I have the following code in my HTML body: So in first.js I have two variables declared in a global scope. Why can't I access them from second.js?
1 2 3 4 5 6 7
8