ics / userhelp-bundle
用户帮助管理包
0.0.5
2021-12-03 13:09 UTC
Requires
- doctrine/orm: ^2.8
- ics/navigation-bundle: ^0
- symfony/config: ^5
- symfony/dependency-injection: ^5
- symfony/form: ^5
- symfony/framework-bundle: ^5
- symfony/routing: ^5
- symfony/security-bundle: ^5
- twig/twig: ^3.3
README
symfony的用户帮助管理
此包提供了symfony的javascript帮助,包括
- Tracelytics pageguide.js用于内联帮助
安装
请确保全局已安装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