maddoger/yii2-website

There is no license information available for the latest version (v1.0.4) of this package.

Website manager extension for Yii2.

Installs: 38

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

v1.0.4 2015-05-26 06:42 UTC

This package is not auto-updated.

Last update: 2024-12-21 17:59:03 UTC


README

Yii2 Website manager by maddoger

Installation

  1. clone
  2. migrate: ##yii migrate --migrationPath=@maddoger/website/common/migrations##
  3. modules:

'modules' => [ ... 'website' => 'maddoger\website\frontend\WebsiteModule', 'website-backend' => 'maddoger\website\backend\WebsiteModule', ... ],

Text formats

Yii->$app->params['textFormats'] => 
  [
      'text' => [
          'label' => 'Text',
          //no widget, simple textarea
          'formatter' => function ($text) {
              return Yii::$app->formatter->asNtext($text);
          }
      ],
      'md' => [
          'label' => 'Markdown',
          //no widget, simple textarea
          'formatter' => function ($text) {
              return yii\helpers\Markdown::process($text, 'gfm');
          }
      ],
      'html' => [
          'label' => Yii::t('maddoger/website', 'HTML'),
          'widgetClass' => '\vova07\imperavi\Widget',
      ],
      'raw' => [
          'label' => Yii::t('maddoger/website', 'Raw'),
      ],
  ],

URL rule

'<languageSlug:[\w-]+>/<slug:.*?>' => 'website/page/index',