bupy7/yii2-pages A static pages module implements CRUD using Imperavi Redactor.

extensionmodulestaticpages

yii2-pages

Latest Stable Version Total Downloads Latest Unstable Version License Build Status Coverage Status

A static pages module implements CRUD using Imperavi Redactor.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist bupy7/yii2-pages "*"

or add

"bupy7/yii2-pages": "*"

to the require section of your composer.json file.

Installation

Add module in your config file:

'bootstrap' => ['pages'],

...

'modules' => [
    ...

    'pages' => 'bupy7\pages\Module',
]

You must add the above config in your console config file to apply migrations.

By default module uses table name '{{%page}}'. If in your database this table is exist - change it adding to configuration of module new table name:

'modules' => [
    ...

    'pages' => [
        'class' => 'bupy7\pages\Module',
        'tableName' => '{{%your_table_name}}',
    ],
]

Run migration

./yii migrate/up --migrationPath=@bupy7/pages/migrations

Without module in console config file this command will throw an exception.

Usage

In module two controllers: default and manager.

manager need for control the pages out of the control panel. You need protect it controller via controllerMap or override it for add behavior with AccessControl.

Example:

'modules' => [
    ...

    'pages' => [
        'class' => 'bupy7\pages\Module',

        ...

        'controllerMap' => [
            'manager' => [
                'class' => 'bupy7\pages\controllers\ManagerController',
                'as access' => [
                    'class' => AccessControl::className(),
                    'rules' => [
                        [
                            'allow' => true,
                            'roles' => ['admin'],
                        ],
                    ],
                ],
            ],
        ],
    ],
],

default for display of pages to site. You need add url rules to file of config for getting content via aliases pages.

Example:

'urlManager' => [
    'rules' => [
        ...

        'pages/<page:[\w-]+>' => 'pages/default/index',
    ],
],

You can upload and add files/images via Imperavi Redactor, if enable it:

'modules' => [
    ...

    'pages' => [
        'class' => 'bupy7\pages\Module',

        ...

        'pathToImages' => '@webroot/images',
        'urlToImages' => '@web/images',
        'pathToFiles' => '@webroot/files',
        'urlToFiles' => '@web/files',
        'uploadImage' => true,
        'uploadFile' => true,
        'addImage' => true,
        'addFile' => true,
    ],
],

Set up the custom language at Imperavi redactor:

'modules' => [
    ...

    'pages' => [
        'class' => 'bupy7\pages\Module',
        'imperaviLanguage' => 'es',
    ],
]

There is all list a languages here: /vendor/vova07/yii2-imperavi-widget/src/assets/lang.

License

yii2-pages is released under the BSD 3-Clause License.

Changelog

yii2-pages

v1.4.1 [2020-05-27]

  • Added support 7.3, 7.4 PHP version.
  • Fixed PostgreSQL bug.

v1.4.0 [2018-09-29]

  • Added the option to display or hide a header in a model (i-panov, bupy7, zacksleo).
  • Added some tests.

v1.3.1 [2018-02-25]

  • Upgrade README.md.

v1.3.0 [2018-02-25]

  • Upgrade dependendens.
  • Higher PHP version. Minimal is 5.6.
  • Added tests.
  • Fixed code style.
  • Fixed #9.

v1.2.1 [2016-11-12]

  • Chinese language support: zh-CN & zh-TW (zacksleo).

v1.2.0 [2016-04-08]

  • Fixed possibility set up of the custom language at Imperavi redactor.
  • vova07/yii2-imperavi-widget updated to 1.2.10.

v1.1.4 [2016-04-06]

  • Fixed set up language of yii2-imperavi-widget (zvook).

v1.1.3 [2016-03-22]

  • Added Italian translation (maxxer).
  • Small enhancement.

v1.1.2 [2016-03-11]

  • Was fixed attribute label at Page model (almix).

v1.1.1 [2016-03-07]

  • Added translation for dutch (amavis442).

v1.1.0 [2015-12-29]

  • Small refactoring.

v1.0.0 [2015-05-04]

  • First release.

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.4.1 is the latest of 11 releases



BSD-3-Clause license
Stats
15 github stars & 22 github forks
1 downloads in the last day
76 downloads in the last 30 days
7173 total downloads