first commit
This commit is contained in:
30
class/smarty_plugins/function.get_articles.php
Normal file
30
class/smarty_plugins/function.get_articles.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* Type: function
|
||||
* Name: get_slider
|
||||
* Purpose: get a slider of known name or id
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
|
||||
use KupShop\ContentBundle\Util\ArticlesUtil;
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @param Smarty $smarty
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function smarty_function_get_articles($params, &$smarty)
|
||||
{
|
||||
$articleUtil = ServiceContainer::getService(ArticlesUtil::class);
|
||||
$ret = $articleUtil->getArticles($params);
|
||||
if (!empty($params['assign'])) {
|
||||
$smarty->assign($params['assign'], $ret);
|
||||
} else {
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user