src/AppBundle/Controller/Admin/TagController.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace AppBundle\Controller\Admin;
use AppBundle\Common\Paginator;
use AppBundle\Common\ArrayToolkit;
use Biz\Taxonomy\Service\TagService;
use Biz\Taxonomy\TagException;
use Symfony\Component\HttpFoundation\Request;
class TagController extends BaseController
{
public function indexAction(Request $request)
{
$total = $this->getTagService()->searchTagCount($conditions = array());
$paginator = new Paginator($request, $total, 20);
$tags = $this->getTagService()->searchTags(
$conditions = array(),
array('createdTime' => 'DESC'),
$paginator->getOffsetCount(),
$paginator->getPerPageCount()
);
foreach ($tags as &$tag) {
$tagGroups = $this->getTagService()->findTagGroupsByTagId($tag['id']);
$groupNames = ArrayToolkit::column($tagGroups, 'name');
if (!empty($groupNames)) {
$tag['groupNames'] = $groupNames;
} else {
$tag['groupNames'] = array();
}
}
return $this->render(
'admin/tag/index.html.twig',
array(
'tags' => $tags,
'paginator' => $paginator,
)
);
}
public function createAction(Request $request)
{
if ('POST' == $request->getMethod()) {
$tag = $this->getTagService()->addTag($request->request->all());
$tagRelation = $this->getTagService()->findTagRelationsByTagIds(array($tag['id']));
return $this->render(
'admin/tag/list-tr.html.twig',
array(
'tag' => $tag,
'tagRelations' => $tagRelation,
)
);
}
return $this->render(
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。