Is it possible to split class definition over two files?
am 08.09.2007 18:22:16 von D_a_n_i_e_lIs it possible to split a class definition over two files?
Thanks.
Is it possible to split a class definition over two files?
Thanks.
D_a_n_i_e_l wrote:
> Is it possible to split a class definition over two files?
>
> Thanks.
>
No.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
D_a_n_i_e_l wrote:
> Is it possible to split a class definition over two files?
>
> Thanks.
>
No, but it's always possible to split one big class into several ones
and use inheritance.
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Jerry Stuckle wrote:
> D_a_n_i_e_l wrote:
>> Is it possible to split a class definition over two files?
>>
>> Thanks.
>
> No.
Really?
I have a class right now that uses at least 3 different files, through
if-include-else-include's.
Beyond that, I use EXTENDS all the time to use more than one file to
define a class.
On Mon, 10 Sep 2007 04:39:58 +0200, Sanders Kaufman
wrote:
> Jerry Stuckle wrote:
>> D_a_n_i_e_l wrote:
>>> Is it possible to split a class definition over two files?
>>>
>>> Thanks.
>> No.
>
> Really?
>
> I have a class right now that uses at least 3 different files, through
> if-include-else-include's.
Inside methods, offcourse it's possible (allthough if/else structures
often (not always!) indicate a flaw in OO design). What is not possible is
this:
class.php
class foo{
include('/path/to/body.php');
}
?>
body.php
function bar(){echo 'foobar';}
?>
or this:
file1.php
class foo{
?>
file2.php
function bar(){ return false;}
}
?>
glueclasstogether.php:
include('file1.php');
include('file2.php');
?>
--
Rik Wasmus
Sanders Kaufman wrote:
> Jerry Stuckle wrote:
>> D_a_n_i_e_l wrote:
>>> Is it possible to split a class definition over two files?
>>>
>>> Thanks.
>>
>> No.
>
> Really?
>
> I have a class right now that uses at least 3 different files, through
> if-include-else-include's.
>
> Beyond that, I use EXTENDS all the time to use more than one file to
> define a class.
>
extending a class creating a new class, not splitting the current
definition across multiple files.
Let's see your code which splits a class across multiple files.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================