NYCPHP Meetup

NYPHP.org

[nycphp-talk] Ok let me ask a better question

Ian Forsyth ian at plusfour.org
Sun Oct 5 23:28:25 EDT 2003


Class Bestilling
{
	var $something;

	function Bestilling ( )
	{
		$this->something = 'Great Choice';
	}

	function display_cart ()
	{
		if ( isset( $this->something ) )
		{
			print $this->something;
		}
	}
}


Class Betaling extends Bestilling
{
	var $foobar;

	function Betaling ()
	{
		$this->Bestilling(); // depending on your version of
		//php you have, you might have to initialize the class you are 
extending
		
		$this->foobar = 'A great purchase';

	}
}


$new_class =& new Betaling;

$new_class->display_cart();


On Sunday, October 5, 2003, at 07:54  PM, Phil Powell wrote:

>  if you have a Bestilling class with method display_cart(), and you 
> have a Betaling class that extends Bestilling, how do you call 
> display_cart from a Betaling class instance?
>  
> Phil
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk




More information about the talk mailing list