Hallo allemaal,
Ik ben nog steeds een beetje aan het sukkelen met classes en vraag mijzelf nu af waarom onderstaande niet werkt...
De bedoeling is dat ie de sitenaam, sitetitle en de naam van de auteur laat zien. Echter komt er alleen te staan:
(http://bit.ly/K8566h)
Quote:
Naam - Naam
Auteur
Ik hoop dat jullie mij op weg kunnen helpen.
Gr.
Jos
Ik ben nog steeds een beetje aan het sukkelen met classes en vraag mijzelf nu af waarom onderstaande niet werkt...
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/class"]class[/URL] info[COLOR= #007700]{
function[/COLOR] site[COLOR= #007700](){[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]name [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Naam[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]title [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Titel[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]name[COLOR= #007700];[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]title[COLOR= #007700];
}
function[/COLOR] author[COLOR= #007700](){[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]name [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Auteur[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]date_a [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]22-05-2012[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]name[COLOR= #007700];[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]date_a[COLOR= #007700];
}
}[/COLOR]
[COLOR= #0000BB]$obj[/COLOR] [COLOR= #007700]= new[/COLOR] info[COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$obj[/COLOR][COLOR= #007700]->[/COLOR]site[COLOR= #007700]([/COLOR]name[COLOR= #007700]) .[/COLOR][COLOR= #DD0000] - [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$obj[/COLOR][COLOR= #007700]->[/COLOR]site[COLOR= #007700]([/COLOR]title[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br /><br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$obj[/COLOR][COLOR= #007700]->[/COLOR]author[COLOR= #007700]([/COLOR]name[COLOR= #007700]);[/COLOR]
?> De bedoeling is dat ie de sitenaam, sitetitle en de naam van de auteur laat zien. Echter komt er alleen te staan:
(http://bit.ly/K8566h)
Quote:
Naam - Naam
Auteur
Ik hoop dat jullie mij op weg kunnen helpen.
Gr.
Jos

17:


