Fleshing out content and committed some new files.
This commit is contained in:
parent
cdd4cb755c
commit
af936d4742
@ -16,7 +16,9 @@ class blogActions extends sfActions
|
||||
*/
|
||||
public function executeIndex()
|
||||
{
|
||||
|
||||
$blogPostTable = Doctrine_Manager::getInstance()->getTable('BlogPost');
|
||||
|
||||
$this->latestBlogPosts = $blogPostTable->retrieveLatest(5);
|
||||
}
|
||||
|
||||
public function executeView()
|
||||
|
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
class blogComponents extends sfComponents
|
||||
{
|
||||
public function executeLatest_blog_posts()
|
||||
{
|
||||
$blogPostTable = Doctrine_Manager::getInstance()->getTable('BlogPost');
|
||||
|
||||
$this->latestBlogPosts = $blogPostTable->retrieveLatest(5);
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<div id="latest_blog_posts">
|
||||
<h3>Latest Blog Posts</h3>
|
||||
<ul>
|
||||
<?php foreach($latestBlogPosts AS $blogPost): ?>
|
||||
<li><?php echo link_to($blogPost->getName(), '@blog_post?slug='.$blogPost->getSlug()); ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
@ -0,0 +1,15 @@
|
||||
<div class="content" id="blog">
|
||||
<h1>Doctrine Blog</h2>
|
||||
|
||||
<?php foreach($latestBlogPosts AS $blogPost): ?>
|
||||
<div class="blog_post">
|
||||
<h2><?php echo link_to($blogPost->getName(), '@blog_post?slug='.$blogPost->getSlug()); ?></h2>
|
||||
|
||||
<p><?php echo $blogPost->getBody(); ?></p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php slot('right'); ?>
|
||||
<?php echo get_partial('latest_blog_posts', array('latestBlogPosts' => $latestBlogPosts)); ?>
|
||||
<?php end_slot(); ?>
|
@ -4,4 +4,8 @@
|
||||
|
||||
<?php slot('right'); ?>
|
||||
<input type="button" name="back_to_blog" value="Back to Blog" onClick="javascript: location.href = '<?php echo url_for('@blog'); ?>';" />
|
||||
<?php end_slot(); ?>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<?php echo get_component('blog', 'latest_blog_posts'); ?>
|
||||
<?php end_slot(); ?>
|
||||
|
@ -16,9 +16,6 @@ class mainActions extends sfActions
|
||||
*/
|
||||
public function executeIndex()
|
||||
{
|
||||
$blogPostTable = Doctrine_Manager::getInstance()->getTable('BlogPost');
|
||||
|
||||
$this->latestBlogPosts = $blogPostTable->retrieveLatest(5);
|
||||
}
|
||||
|
||||
public function executeAbout()
|
||||
|
@ -17,12 +17,5 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="latest_blog_posts">
|
||||
<h3>Latest Blog Posts</h3>
|
||||
<ul>
|
||||
<?php foreach($latestBlogPosts AS $blogPost): ?>
|
||||
<li><?php echo link_to($blogPost->getName(), '@blog_post?slug='.$blogPost->getSlug()); ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php echo get_component('blog', 'latest_blog_posts'); ?>
|
||||
<?php end_slot(); ?>
|
@ -4,5 +4,6 @@
|
||||
<li><?php echo link_to('download', '@download'); ?></li>
|
||||
<li><?php echo link_to('manual', '@manual'); ?></li>
|
||||
<li><?php echo link_to('api docs', '@api_documentation'); ?></li>
|
||||
<li><?php echo link_to('blog', '@blog'); ?></li>
|
||||
<li id="last"><?php echo link_to('trac', '@trac'); ?></li>
|
||||
</ul>
|
Loading…
Reference in New Issue
Block a user