Skip to content

Commit

Permalink
Add missing factory for blog article listing view helper
Browse files Browse the repository at this point in the history
  • Loading branch information
jurreantonisse committed May 20, 2015
1 parent 403c508 commit 5b65ea1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@
),

'view_helpers' => array(
'factories' => array(
'blogArticles' => 'Soflomo\Blog\Factory\BlogArticleListingFactory',
),
'invokables' => array(
'slug' => 'Soflomo\Blog\View\Helper\Slug'
),
Expand Down Expand Up @@ -363,4 +366,4 @@
),
),
),
);
);
31 changes: 31 additions & 0 deletions src/Soflomo/Blog/Factory/BlogArticleListingFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* Copyright (c) 2013 Soflomo.
* All rights reserved.
*
* This license allows for redistribution, commercial and non-commercial, as
* long as it is passed along unchanged and in whole, with credit to Soflomo.
*
* @author Jurian Sluiman <jurian@soflomo.com>
* @copyright 2013 Soflomo.
* @license http://creativecommons.org/licenses/by-nd/3.0/ CC-BY-ND-3.0
* @link http://soflomo.com
*/

namespace Soflomo\Blog\Factory;

use Soflomo\Blog\View\Helper\BlogArticleListing;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

class BlogArticleListingFactory implements FactoryInterface
{
public function createService(ServiceLocatorInterface $sl)
{
$blogRepository = $sl->getServiceLocator()->get('Soflomo\Blog\Repository\Blog');
$articleRepository = $sl->getServiceLocator()->get('Soflomo\Blog\Repository\Article');

$helper = new BlogArticleListing($blogRepository, $articleRepository);
return $helper;
}
}

0 comments on commit 5b65ea1

Please sign in to comment.