承接 twin-elements/post-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

twin-elements/post-bundle

最新稳定版本:v1.8.0

Composer 安装命令:

composer require twin-elements/post-bundle

包简介

Posts for CMS

README 文档

README

#Installation 1.composer

2.Add to routes.yaml

post_admin:
    resource: "@TwinElementsPostBundle/Controller/Admin/"
    prefix: /admin
    type: annotation
    requirements:
        _locale: '%app_locales%'
    defaults:
        _locale: '%locale%'
        _admin_locale: '%admin_locale%'
    options: { i18n: false }

Preview url generator

Create class PostPreviewGenerator

class PostPreviewGenerator implements PostPreviewGeneratorInterface
{
    private RouterInterface $router;

    public function __construct(RouterInterface $router)
    {
        $this->router = $router;
    }

    public function generatePreviewUrl(Post $post): string
    {
        return $this->router->generate('post', [
            'id' => $post->getId(),
            'slug' => $post->getSlug()
        ]);
    }
}

in service.yaml

services:
    TwinElements\PostBundle\UrlGenerator\PostPreviewGeneratorInterface:
        alias: 'App\PreviewUrlGenerator\PostPreviewGenerator'

统计信息

  • 总下载量: 139
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-17