2017 © Pedro Peláez
 

yii2-extension yii2-view-pages

Yii2 view pages

image

fgh151/yii2-view-pages

Yii2 view pages

  • Tuesday, April 4, 2017
  • by fgh151
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yii2 view pages

Yii2 view pages, (*1)

Installation

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

Either run, (*3)

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

or add, (*4)

"fgh151/yii2-view-pages": "*"

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

Usage

Once the extension is installed, simply add it in your config by : Basic config/web.php, (*6)

Advanced [backend|frontend|common]/config/main.php, (*7)

    'modules' => [
        'pages' => [
            'class' => 'fgh151\vpages\Module',
        ],
        //...
    ]

Example usage

Create php file in @webroot directory or sub folder, for example, (*8)

Yii::getAlias('@webroot').'/catalog/index.php';

Now you have urls:, (*9)

  • ?r=pages/page/view&page=catalog/index.php
  • ?r=pages/page/view&page=catalog/
  • ?r=pages/page/view&page=catalog

For SEF url you may add rule to config:, (*10)

 'urlManager' => [
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'rules' => [
        '<page:\w+>' => 'pages/page/view',
    ],
],

If there is files style.css or script.js in view dir (/catalog/ as example above) they will be automatically added., (*11)

RBAC

You can use RBAC with module. Simply add it in your config:, (*12)


'modules' => [ 'pages' => [ 'class' => 'fgh151\vpages\Module', 'as access' => [ 'class' => 'yii\filters\AccessControl', 'rules' => [ [ 'allow' => true, 'roles' => ['admin'], ] ] ] ] ... ... ],

The Versions

04/04 2017

dev-master

9999999-dev

Yii2 view pages

  Sources   Download

MIT

The Requires

 

extension yii2 view pages

04/04 2017

v0.1

0.1.0.0

Yii2 view pages

  Sources   Download

MIT

The Requires

 

extension yii2 view pages