Re: Class and subclass
| From: | Robert Cummings | Date: | Wed, 07 Mar 2007 13:28:35 +0000 |
| Subject: | Re: Class and subclass | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-249970@lists.php.net to get a copy of this message | ||
On Wed, 2007-03-07 at 14:23 +0100, Alain Roger wrote:
> Hi,
>
> i have a class A with some properties.
> i have a class B with several public functions (i.e : Render())
>
> i would like to do something like that :
>
> class B()
> {
> B()
I'm pretty sure you mean "function B()" or in PHP 5 "function
__construct()".
> {
> }
>
> public function Render()
> {
> ...
> }
> }
>
> class A
> {
> private $myotherclass;
>
> A()
Similarly, I'm pretty sure you mean "function A()" or in PHP 5 "function
__construct()".
> {
> $this->myotherclass = new classB();
> }
>
> public function test()
> {
> $this->myotherclass->Render();
> }
> }
>
> however, i'm not able to access to ->Render() of class B from Class A
> property. Where could be the problem ?
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'