|
Posted by Bonge Boo! on 05/26/05 09:59
On 26/5/05 7:53 am, in article Gnele.1486038$8l.366880@pd7tw1no, "Paul"
<freelance@dezignage.net> wrote:
>> So if anyone can point the way to getting variables into a class from
>> "outside" I would appreciate it.
>>
> sorry just a quick note I caught myself on...
>
> inside the object you'd have to declare the variable... like so..
>
> class Cart {
> var $var;
>
> function Cart() {
> $this->var =& $GLOBALS['var'];
> }
>
> }
Ummm. Forigve the dim question. I have a lot of functions in this class. I
wouldn't need to declare them inside each function would I?
Big gulp.
If that was the case it would be easier to just do as I currently do and
define the variables inside the class explicitly. Which works beautifully,
but I'm trying to make my code as streamlined and centralised as possible,
mainly do to my own ineptness making me worry I'll lose track.
Navigation:
[Reply to this message]
|