Re: require/include a file inside a function [message #172538 is a reply to message #172518] |
Mon, 21 February 2011 17:34 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 2/21/2011 10:02 AM, Simon wrote:
>>
>> No, files included in a function are NEVER accessible globally. They are
>> only available in the function - it's part of what functions do.
>
> Yes this is what I thought would happen, (as per my original post), but
> the reply from Paul gave the impression that maybe I was wrong.
>
> auoload is probably best for what I am trying to do, it will globally
> include files needed, when they are needed.
>
> I just need to come up with a 'nice' naming convention of some sort to
> make sure I don't get myself in a mess over time.
>
> Simon
>
I just use appropriate naming conventions and require_once() the files
as I need them. That way I KNOW what I'm getting. That's not always
true with autoload.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|