src/AppBundle/Twig/AppExtension.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace AppBundle\Twig;
use AppBundle\Common\ServiceToolkit;
use Biz\Course\Service\CourseService;
use Biz\System\Service\SettingService;
use Codeages\Biz\Framework\Context\Biz;
use Biz\Course\Service\CourseSetService;
use Symfony\Component\DependencyInjection\ContainerInterface;
class AppExtension extends \Twig_Extension
{
/**
* @var Biz
*/
protected $biz;
/**
* @var ContainerInterface
*/
private $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
$this->biz = $container->get('biz');
}
public function getFilters()
{
return array(
new \Twig_SimpleFilter('currency', array($this, 'currency')),
new \Twig_SimpleFilter('json_encode_utf8', array($this, 'jsonEncodeUtf8')),
);
}
public function getFunctions()
{
return array(
new \Twig_SimpleFunction('services', array($this, 'buildServiceTags')),
new \Twig_SimpleFunction('classroom_services', array($this, 'buildClassroomServiceTags')),
new \Twig_SimpleFunction('count', array($this, 'count')),
new \Twig_SimpleFunction('course_count', array($this, 'courseCount')),
new \Twig_SimpleFunction('course_cover', array($this, 'courseCover')),
new \Twig_SimpleFunction('course_set_cover', array($this, 'courseSetCover')),
//@deprecated 请勿使用,后续将删除 2017-03-30
//@see WebExtension#avatarPath
new \Twig_SimpleFunction('user_avatar', array($this, 'userAvatar')),
new \Twig_SimpleFunction('course_price', array($this, 'coursePrice')),
new \Twig_SimpleFunction('log_trans', array($this, 'logTrans')),
);
}
/*
* 返回金额的货币表示
* @param money 金额,单位:分
*
*/
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。