PHP code example of maddoger / yii2-website

1. Go to this page and download the library: Download maddoger/yii2-website library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

maddoger / yii2-website example snippets


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'),
      ],
  ],

'<languageSlug:[\w-]+>/<slug:.*