Consider using the __autoload() function in php.
(also the SPL autoloading features).
It's a way to tell php to load a file when it cannot find a definition for a
CLASS (only for classes).
I don't know how you have set-uped your project, but in mine the only place
in the project where I use inclu
Jason Barnett wrote:
Dubreuilmedia wrote:
Hi
I was wondering about includes and classes. I have a class in which
depending on a member variable, i should load
the proper include, which is really the proper config file for that
moment.
How does a member variable control this? E.g. you set the
Dubreuilmedia wrote:
Hi
I was wondering about includes and classes. I have a class in which
depending on a member variable, i should load
the proper include, which is really the proper config file for that moment.
How does a member variable control this? E.g. you set the member
variable in the
On Thu, 18 Jul 2002 08:40:08 -0600, you wrote:
See below...
>At 09:20 PM 7/17/02 -0500, Michael Sims wrote:
>
>>$superglobals = array("var1", "var2", "var3", "var4", "var5", "...");
>>
>>Now inside the function you can do this:
>>
>>function somefunction ($somevar) {
>>
>> global $superglobals
At 09:20 PM 7/17/02 -0500, Michael Sims wrote:
>$superglobals = array("var1", "var2", "var3", "var4", "var5", "...");
>
>Now inside the function you can do this:
>
>function somefunction ($somevar) {
>
> global $superglobals;
> foreach($superglobals as $varname) {
> global $$varname; //r
[snip]
Chris, thanks for describing your method. The reason I really dislike
Functions in PHP is because you have to pass every variable needed by a
function, even if that variable is global in the main script, which is a
pain in the ass when a function needs a long string of variables. It makes
i
> >Chris, thanks for describing your method. The reason I really dislike
> >Functions in PHP is because you have to pass every variable needed by a
> >function, even if that variable is global in the main script, which is a
> >pain in the ass when a function needs a long string of variables. It
ma
On Wed, 17 Jul 2002 17:46:25 -0400, you wrote:
>Chris, thanks for describing your method. The reason I really dislike
>Functions in PHP is because you have to pass every variable needed by a
>function, even if that variable is global in the main script, which is a
>pain in the ass when a function
Chris, thanks for describing your method. The reason I really dislike
Functions in PHP is because you have to pass every variable needed by a
function, even if that variable is global in the main script, which is a
pain in the ass when a function needs a long string of variables. It makes
it easie
I am not sure about efficiency, myself and I often ask this without much if
anything at all for a response. However, I am the opposite of you, in that I
prefer to create a library file containing all the functions. To make
developing the page in something like Dreamweaver or Frontpage easier, I
gl
>what is the path of the "includes" directory
>in a windows dist of PHP (current version)?
>
>is that where all the dlls are?
No.
The DLLs are in your "extensions_path" (or something like that).
Your include_path is where *YOUR* PHP files can be placed so you can use
them in multiple scripts.
we still use include();
setup.php has something like:
if(file_exists($page) and ...more...controls..)
include_once $page;
then the $page.php is where you have a part of your site.
You can pass $page as the GET variable: setup.php?page=page.php
and so on
Maxim Maletsky
Founde
12 matches
Mail list logo