On 24/08/07, Michael Heyder <Info(a)hafenvolleyballer.de> wrote:
Hi,
my last question for today.
the only thing I've got is the title of the article (new one)!
$title='Creating an article object';
$article=new Article($title); // seems to be not the right way
If you had read the code documentation, or the comments for the
Article class, you would realise that the Article constructor accepts
a Title object.
MediaWiki uses Title objects all over the place to represent titles;
the Title class performs normalisation and handles issues such as
namespaces, etc. cleanly.
You therefore need to instantiate a Title, which is usually done with
one of the following factory functions:
* Title::makeTitle()
* Title::makeTitleSafe()
* Title::newFromText()
For example:
$title = Title::newFromText( "Creating Article object" );
$article = new Article( $title );
Rob Church