承接 presta/sonata-bookmarks-bundle 相关项目开发

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

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

presta/sonata-bookmarks-bundle

最新稳定版本:v1.0.0

Composer 安装命令:

composer require presta/sonata-bookmarks-bundle

包简介

A Symfony bundle to allow user to save and share bookmarks Sonata Admin

README 文档

README

PrestaSonataBookmarksBundle will allow your Sonata users to save bookmarks in admin.

Preview

On each admin, you can save a page as bookmark to a dedicated database entry, after naming it. Save bookmark form

An admin exists where you can remove bookmarks created in the application. Bookmarks admin list

Installation

Install the bundle with the command:

composer require presta/sonata-bookmarks-bundle

Enable the bundle:

# config/bundles.php
return [
+    Presta\SonataBookmarksBundle\PrestaSonataBookmarksBundle::class => ['all' => true],
];

Configuration

Import our Javascripts in your project:

import '../../public/bundles/prestasonatabookmarks/scripts/app';

This step is highly dependent on how your public assets are built, imported. It's up to you knowing the best way to include it in your project.

Include our action template into the Twig template you configured to be your admin layout:

{% extends '@SonataAdmin/standard_layout.html.twig' %}

{% block sonata_top_nav_menu %}
    <ul class="nav navbar-nav">
        <li>{{ include('@PrestaSonataBookmarks/admin/bookmark_action.html.twig') }}</li>
    </ul>
    {{ parent() }}
{% endblock %}

See related SonataAdmin documentation

Configure to doctrine that what entity will be attached to bookmarks config/packages/doctrine.yaml:

<?php

use Doctrine\ORM\Mapping as ORM;
use Presta\SonataBookmarksBundle\Entity\BookmarkOwnerInterface;
use Symfony\Component\Security\Core\User\UserInterface;

#[ORM\Entity]
class User implements UserInterface, BookmarkOwnerInterface
{
}
# config/packages/doctrine.yaml
doctrine:
  orm:
    resolve_target_entities:
      Presta\SonataBookmarksBundle\Entity\BookmarkOwnerInterface: 'App\Entity\User'

See related DoctrineBundle documentation

Finally, update your schema to create the tables required for our entities:

bin/console doctrine:schema:update 

Or create a migration if you have DoctrineMigrationsBundle installed:

bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate

This project is supported by PrestaConcept

Released under the MIT License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-30