From: Carsten K. <car...@us...> - 2002-11-20 17:08:41
|
I believe the HTML object is Jeff's own creation so it is really part of PhpWiki. It is fantastic to work with, I would like to see it become part of PHP! The code is in lib/XmlElement.php and lib/HtmlElement.php and is used throughout PhpWiki. The other plugins make good examples, they are a good place to start to learn a little more how it works. Carsten p.s. oops, probably you already noticed a mistake in my code: - $MOTD = explode("\n", htmlentities($MOTD)); // make an array to + $MOTD = explode("\n", $MOTD); // make an array to On Tuesday, November 19, 2002, at 08:37 pm, Loyd Goodbar wrote: > Thanks, that worked nicely. Is the html object part of PHP now, or is > it part > of PEAR? Where can I find more? > > Thanks, > Loyd > > On Tue, 19 Nov 2002 00:41:39 -0500, Carsten Klapp > <car...@us...> wrote: > >> Hi Loyd, >> >> Yes the HelloWorld plugin comments are a little vague and out of date, >> the returned value should now use the HTML class functions not raw >> strings. Try something like this: >> >> $MOTD = "One moon shows in every pool;\nIn every pool, the one >> moon."; >> $MOTD = explode("\n", htmlentities($MOTD)); // make an array to >> walk through later >> >> $html = HTML(); // new HTML object >> foreach ($MOTD as $line) >> $html->pushContent($line, HTML::br()); // add each line to the >> html object >> >> $html->unshiftContent(HTML::h2(_("Message of the Day"))); >> >> return $html; >> >> Carsten |