コード例 #1
0
<?php

use PhlyBlog\AuthorEntity;
use PhlyBlog\EntryEntity;
$author = new AuthorEntity();
$author->setId('matthew');
$author->setName("Matthew Weier O'Phinney");
$author->setEmail('*****@*****.**');
$author->setUrl('http://mwop.net/');
$post = new EntryEntity();
$post->setTitle('Zend Framework 1.12.11 Released!');
$post->setAuthor($author);
$post->setDraft(false);
$post->setPublic(true);
$post->setCreated(new DateTime('2015-02-11 11:00', new DateTimezone('America/Chicago')));
$post->setUpdated(new DateTime('2015-02-11 11:00', new DateTimezone('America/Chicago')));
$body = <<<'EOS'
<p>
    The Zend Framework community is pleased to announce the immediate availability
    of:
</p>

<ul>
    <li>Zend Framework <strong>1.12.11</strong></li>
</ul>

<p>You can download Zend Framework at:</p>

<ul>
    <li>
        <a href="/downloads/latest#ZF1">http://framework.zend.com/downloads/latest#ZF1</a>
コード例 #2
0
ファイル: sample-post.php プロジェクト: vrkansagara/ZFBlog
<?php

use PhlyBlog\AuthorEntity;
use PhlyBlog\EntryEntity;
$entry = new EntryEntity();
$author = new AuthorEntity();
$author->fromArray(array('id' => 'yourusername', 'name' => 'Your Full Name', 'email' => '*****@*****.**', 'url' => 'http://your.tld/'));
$entry->setId('this-is-the-stub-used-in-the-uri-and-should-be-unique');
$entry->setTitle('New site!');
$entry->setAuthor($author);
$entry->setDraft(false);
$entry->setPublic(true);
$entry->setCreated(1300744335);
$entry->setUpdated(1301034313);
$entry->setTimezone('America/New_York');
$entry->setTags(array('php', 'personal'));
$body = <<<'EOT'
<p>
    This is the principal body of the post, and will be shown everywhere.
</p>
EOT;
$entry->setBody($body);
$extended = <<<'EOT'
This is the extended portion of the entry, and is only shown in the main entry 
views.
EOT;
$entry->setExtended($extended);
return $entry;