2017 © Pedro Peláez
 

yii2-extension yii2-page-help

Yii2 extention to attach help pages to any controller action

image

tunect/yii2-page-help

Yii2 extention to attach help pages to any controller action

  • Monday, September 25, 2017
  • by dvatri
  • Repository
  • 1 Watchers
  • 0 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

Controller action-based page help storage extension for Yii2 framework

This module provides ability to create help pages and link them to your app controller's actions. Widged can be used to display modal pop-over with help page linked to particular (current) action for end users., (*1)

Installation

Run to install extension:, (*2)

composer require tunect/yii2-page-help

Run migration:, (*3)

./yii migrate

It's possible to add custom migration paths since Yii2 2.0.10 (module adds it's path in tunect\Yii2PageHelp\Bootstrap file), (*4)

Additional settings are optional., (*5)

Module settings

To specify module name (default name is help) set it in index.php or in config file (before config goes to Application constructor):, (*6)

\tunect\Yii2PageHelp\Module::$moduleName = 'custom-help';

Module settings can be changed in app config:, (*7)

'modules' => [
    'help' => [
        'class' => 'tunect\Yii2PageHelp\Module',
        'tableName' => '{{%custom_table_name}}',
        'roles' => function () {
            return [\app\models\User::ROLE_ADMIN];
        },
    ],
],

Note: Settings should be specified both in web and console app configs since this module has a migration. Or you can use common config, merge config parts, etc., (*8)

By default '@' (any authenticated user) role will be used, but any other role(s) can be defined in roles module property (see example above). It can take scalar value, array or callable., (*9)

Usage

To create or update help for any page of your website visit /<module_name>/index page (by default /help/index). <module_name> is the name module was registred with, if you changed Module::$moduleName - use your value., (*10)

Page field should contain page path in format <controller>/<action> OR <module>/<controller>/<action>, check looks like:, (*11)

$this->page = Yii::$app->controller->id . '/' . Yii::$app->controller->action->id;
// Add module prefix
if (Yii::$app->controller->module->id !== Yii::$app->id) {
    $this->page = Yii::$app->controller->module->id . '/' . $this->page;
}

Module name being checked only if current action is not an application's controller action:, (*12)

  • help/default/index for help module default controller and index action
  • site/login for main application site controller and login action

Content field can contain any help info with Markdown support. This content will be displayed in modal available for particular page., (*13)

To add help modal button to layout just add widget to any place in view (layout) file (e.g. next to page header h1):, (*14)

<?= \tunect\Yii2PageHelp\widgets\HelpButton::widget(); ?>

On button click modal will be displayed. Button will be visible only if help record exists for current page., (*15)

(the name module was registred with, if you changed Module::$moduleName - use your value as a path)., (*16)

TODO

  • Implement global search

The Versions

25/09 2017

dev-master

9999999-dev

Yii2 extention to attach help pages to any controller action

  Sources   Download

BSD-3-Clause

The Requires

 

by Tunect

25/09 2017

1.0.8

1.0.8.0

Yii2 extention to attach help pages to any controller action

  Sources   Download

BSD-3-Clause

The Requires

 

by Tunect

11/09 2017

1.0.7

1.0.7.0

Yii2 extention to attach help pages to any controller action

  Sources   Download

BSD-3-Clause

The Requires

 

by Tunect

18/08 2017

1.0.6

1.0.6.0

Yii2 extention to attach help pages to any controller action

  Sources   Download

BSD-3-Clause

The Requires

 

by Tunect

08/08 2017

1.0.5

1.0.5.0

Yii2 extention to attach help pages to any controller action

  Sources   Download

BSD-3-Clause

The Requires

 

by Tunect

08/08 2017

1.0.4

1.0.4.0

Yii2 extention to attach help pages to any controller action

  Sources   Download

BSD-3-Clause

The Requires

 

by Tunect

01/07 2017

1.0.3

1.0.3.0

Yii2 extention to attach help pages to any controller action

  Sources   Download

BSD-3-Clause

The Requires

 

by Tunect

01/07 2017

1.0.2

1.0.2.0

Yii2 extention to attach help pages to any controller action

  Sources   Download

BSD-3-Clause

The Requires

 

by Tunect

01/07 2017

1.0.1

1.0.1.0

Yii2 extention to attach help pages to any controller action

  Sources   Download

BSD-3-Clause

The Requires

 

by Tunect

01/07 2017

1.0.0

1.0.0.0

Yii2 extention to attach help pages to any controller action

  Sources   Download

BSD-3-Clause

The Requires

 

by Tunect