I guess my problem is that the condition happens within a function of
the class. I'll have to figure out a way around that.
Chris Lee wrote:
>
> Its called inheritance.
> rarley.php
> <?php
>
> class rarley_used
> {
> function one()
> {
>
> }
>
> function two()
> {
>
> }
> }
> ?>
>
> main_class.php
> <?php
>
> include_once('rarley.php');
>
> class main_class extends rarley_used
> {
> function three()
> {
>
> }
>
> function four()
> {
>
> }
> }
> ?>
>
> --
>
> Chris Lee
> Mediawaveonline.com
> [EMAIL PROTECTED]
>
> "Monte Ohrt" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I have a class with many functions. About 80% of these functions are
> > rarely used, so I'd like to split them out to a separate file and
> > include them only if a certain condition applies. This way the PHP
> > compiling is kept to a minimum. How do I make the included functions
> > members of the current class?
> >
> > Example:
> >
> >
> > myclass.php
> > -----------
> >
> > <?php
> >
> > class MyClass {
> >
> > function func1() {
> > if($foo) {
> > include_once("myclass2.php");
> > $this->func2(); // this doesn't work, it won't find func2!
> > }
> > }
> >
> > }
> >
> > ?>
> >
> > myclass2.php
> > ------------
> >
> > <?php
> >
> > // I need these functions to be
> > // members of MyClass... how?
> > function func2() {
> > // do something
> > }
> >
> > }
> >
> > ?>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
Monte Ohrt <[EMAIL PROTECTED]>
http://www.ispi.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]