-
Notifications
You must be signed in to change notification settings - Fork 0
Article __construct
perrym5 edited this page Apr 22, 2011
·
2 revisions
This is the constructor for the Article class.
Article Article->__construct( [variable list] )
Option 1: Supply the constructor with a hash containing the keys: "headline", "summary", "date", and "url"
Option 2: Supply four seperate arguments which are: $headling, $summary, $date, $url
Creates a new Article object
Code:
<?php
$data["headline"] = "Example Article";
$data["summary"] = "This is an example article!";
$data["date"] = date();
$data["url"] = "http://www.rpi.edu/";
$a = new Article( $data );
echo $a->headline;
?>
Outputs:
Example Article