ics/userhelp-bundle

用户帮助管理包

安装: 3

依赖关系: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 0

语言:JavaScript

类型:symfony-bundle

0.0.5 2021-12-03 13:09 UTC

This package is auto-updated.

Last update: 2024-09-29 06:20:24 UTC


README

symfony的用户帮助管理

此包提供了symfony的javascript帮助,包括

安装

请确保全局已安装Composer,如Composer文档的安装章节中所述。

使用Symfony Flex的应用程序

打开命令行,进入您的项目目录并执行

composer require ics/userhelp-bundle

不使用Symfony Flex的应用程序

步骤 1:下载包

打开命令行,进入您的项目目录并执行以下命令以下载此包的最新稳定版本

$ composer require ics/userhelp-bundle

步骤 2:启用包

然后,通过将其添加到项目config/bundles.php文件中注册的包列表中来启用该包

// config/bundles.php

return [
    // ...
    ICS\UserhelpBundle\UserhelpBundle::class => ['all' => true],
];

配置

帮助初始化

base.html.twig中添加这些行。只有在userhelp.yaml中配置了路由时,代码才会显示帮助

{# ... #}
{{  AddHelpCSS() }}
{% block stylesheets %}

{% endblock %}
{# ... #}
{{  AddHelpJS() }}
{% block javascripts %}

{% endblock %}
{# ... #}
{% block body %}

{% endblock %}
{{ AddHelpHtml() }}

帮助配置

创建一个新的文件userhelp.yaml

userhelp:
  helpColor: primary
  helpButtonIdentifier: helpButton
  helps:
    homepage: # route to add help
      elements:
        titlePage: # html element id
          position: bottom
          description: Title of the page # help for this element
        mainmenu:
          position: right
          description: Main menu
        homepagelink:
          position: right
          description: return to <i class="fa fa-home"></i> homepage # html is enabled in help element

helpcolor属性值:

  • primary
  • secondary
  • success
  • warning
  • danger
  • info
  • dark

position属性值:

  • left
  • top
  • right
  • bottom

入门初始化

路由安装

如果用户看到了所有入门,Intro需要保存路由,配置config/routes.yaml

# config/routes.yaml

userhelp_bundle:
  resource: "@UserhelpBundle/config/routes.yaml"
  prefix: /user/help

将js和css文件添加到您的base.html.twig中。只有在userhelp.yaml中配置了路由时,代码才会显示入门

{# base.html.twig #}
{# ... #}
{{  AddIntroCSS() }}
{% block stylesheets %}

{% endblock %}
{# ... #}
{{  AddIntroJS() }}
{% block javascripts %}

{% endblock %}

入门配置

创建一个新的文件userhelp.yaml

userhelp:
  introButtonIdentifier: introButton
  introTheme: modern
  intros:
    homepage: #Route name
      elements:
        pagetitle: #Element where intro step attach
          title: Page title
          description: description of the page title #Support HTML
        leftmenu:
          title: Menu of page
        mainpage:
          title: Content of page
        rightmenu:
          title: Menu of page

introTheme属性值:

  • dark
  • flattener
  • modern
  • nassim
  • nazanin
  • royal