diff --git a/config/module.config.php b/config/module.config.php index 3ec8abd..af2febf 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -309,6 +309,9 @@ ), 'view_helpers' => array( + 'factories' => array( + 'blogArticles' => 'Soflomo\Blog\Factory\BlogArticleListingFactory', + ), 'invokables' => array( 'slug' => 'Soflomo\Blog\View\Helper\Slug' ), @@ -363,4 +366,4 @@ ), ), ), -); \ No newline at end of file +); diff --git a/src/Soflomo/Blog/Factory/BlogArticleListingFactory.php b/src/Soflomo/Blog/Factory/BlogArticleListingFactory.php new file mode 100644 index 0000000..4641bc8 --- /dev/null +++ b/src/Soflomo/Blog/Factory/BlogArticleListingFactory.php @@ -0,0 +1,31 @@ + + * @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; + } +}