Posting source code at wordpress.com

Posted on July 7, 2009

1


Just posted my first source code example. I had to fiddle around a bit to get it to work.
The snippet shoud be wrapped in a sourcecode tag, like this:

 // or 'php', 'java', 'xml'...
... code ...

For avoiding span tags automatically inserted by the editor, it’s safest to paste the wrapping sourcecode tag, including the code snippet, in the editor HTML mode.

class TestService
{
    /**
     * @return Group
     */
    public function getGroup()
    {
        $group = new Group();

       	$person = new Person();
        $person->name = "Annah";
		$group->persons[] = $person;

        return $group;
    }
}

Thanks to Joeren Plumier’s blog!’

Advertisements
Posted in: Uncategorized