2017 © Pedro Peláez
 

yii2-extension yii2-faq

Yii2 FAQ module

image

usesgraphcrt/yii2-faq

Yii2 FAQ module

  • Wednesday, March 15, 2017
  • by usesgraphcrt
  • Repository
  • 2 Watchers
  • 2 Stars
  • 152 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

yii2-faq-module

FAQ module for Yii2, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist usesgraphcrt/yii2-faq "*"

or add, (*4)

"usesgraphcrt/yii2-faq": "*"

to the require section of your composer.json file., (*5)

Make migration, (*6)

php yii migrate --migrationPath=@vendor/usesgraphcrt/yii2-faq/migrations/

Usage

You should add module to your config:, (*7)

'modules' => [
        ...
        'faq' => [
                    'class' => \usesgraphcrt\faq\Module::className(),
                    'imagesUrl' => 'http://my_site_name/upload/faq/',
                    'imagesPath' => '@frontend/web/upload/faq/',//realpath(__DIR__.'/../../frontend/web/upload/faq/')
                ],
    ],

You should use 'imagesUrl' and 'imagesPath' to define folder to store your images for FAQ. This variables should define same directory. In above example images will be saved in '@frontend/web/upload/faq' directory. You should define both variables because Imperavi widget used in this module and they needed to this widget., (*8)

If you use advanced project template you should configure both config.php with the same values, (*9)

You can add link to this module in your backend navbar:, (*10)

$menuItems[] = ['label' => 'FAQ', 'url' => ['/faq/main/view']];

To display FAQ just add:, (*11)

echo \usesgraphcrt\faq\widgets\FaqWidget\FaqWidget::widget();

Widget have two parameters - 'title' and 'breadcrumbs' with default value 'false', which means that no title and no breadcrumbs will be applied on page with widget. It is useful if you will place widget on existing page with other information. If you locate widget on separate page and want to specify title or breadcrumbs (or maybe both of them) you can call widget like this:, (*12)

echo \usesgraphcrt\faq\widgets\FaqWidget\FaqWidget::widget([
    'title' => Yii::t('app', 'FAQ'),
    'breadcrumbs' => Yii::t('app', 'FAQ page'),
]);

It is possible that you have to change minimum stability section of your composer.json file to dev, (*13)

"minimum-stability": "dev",

Module support Russian and English languages. By default language for Imperavi widget is Russian ('ru'). You can change it to English by adding to module config, (*14)

'imperaviLanguage' => 'en'

The module is under construction, (*15)

The Versions

15/03 2017

dev-master

9999999-dev

Yii2 FAQ module

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar usesgraphcrt

yii2 module faq