2017 © Pedro Peláez
 

yii2-extension yii2-render-many

Yii Framework 2 extension for render many views in one action (best solution for landing pages or pages with many content blocks)

image

igogo5yo/yii2-render-many

Yii Framework 2 extension for render many views in one action (best solution for landing pages or pages with many content blocks)

  • Sunday, July 24, 2016
  • by igogo5yo
  • Repository
  • 3 Watchers
  • 10 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

RenderMany extension for Yii Framework 2

Latest Stable Version Total Downloads License Dependency Status, (*1)

Yii Framework 2 extension for render many views in one action (best solution for landing pages or pages with many content blocks), (*2)

Please submit issue reports and pull requests to the main repository. For license information check the LICENSE-file., (*3)

Installation

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

Either run, (*5)

php composer require --prefer-dist igogo5yo/yii2-render-many

or add, (*6)

"igogo5yo/yii2-render-many": ">=1.0"

to your composer.json file, (*7)

Example

use trait, (*8)

...
class MyController extends Controller {
    use igogo5yo\rendermany\RenderMany;

    public function actionIndex()
    {

        return $this->renderMany([
            'sliderSection' => [
                'slides' => ['img1.jpg', 'img3.jpg', 'img3.jpg']
            ],
            'contentSection' => [
                'title' => 'My post',
                'description' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry...',
            ],
            'partnersSection' => [
                'partners' => [
                    ['link' => '#', 'name' => 'partner 1'],
                    ['link' => '#', 'name' => 'partner 2'],
                    ['link' => '#', 'name' => 'partner 3'],
                ]
            ],
            'footer' //without passing variables
        ]);
    }
}

or extend your controller, (*9)


class MyController extends igogo5yo\rendermany\Controller { public function actionIndex() { return $this->renderMany([ 'sliderSection' => [ 'slides' => ['img1.jpg', 'img3.jpg', 'img3.jpg'] ], 'contentSection' => [ 'title' => 'My post', 'description' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry...', ], 'partnersSection' => [ 'partners' => [ ['link' => '#', 'name' => 'partner 1'], ['link' => '#', 'name' => 'partner 2'], ['link' => '#', 'name' => 'partner 3'], ] ], 'footer' //without passing variables ]); } }

also you can use partial rendering, (*10)

    public function actionIndex()
    {

        return $this->renderMany([
            'sliderSection' => [
                'slides' => ['img1.jpg', 'img3.jpg', 'img3.jpg']
            ],
            'wrapper' => [
                'innerRenders' => $this->renderManyPartial([
                    'innerView1' => [
                        'param1' => 'some data 1'.
                        'param2' => 'some data 2'
                    ],
                    'innerView2' //without passing variables
                ])
            ],
            'footer' //without passing variables
        ]);
    }

The Versions

24/07 2016

dev-master

9999999-dev

Yii Framework 2 extension for render many views in one action (best solution for landing pages or pages with many content blocks)

  Sources   Download

MIT

The Requires

 

by Skliar Ihor

framework yii2 views render igogo5yo many

24/07 2016

1.4

1.4.0.0

Yii Framework 2 extension for render many views in one action (best solution for landing pages or pages with many content blocks)

  Sources   Download

MIT

The Requires

 

by Skliar Ihor

framework yii2 views render igogo5yo many

07/12 2015

1.3

1.3.0.0

Yii Framework 2 extension for render many views in one action (best solution for landing pages or pages with many content blocks)

  Sources   Download

MIT

The Requires

 

by Skliar Ihor

framework yii2 views render igogo5yo many

07/12 2015

1.2

1.2.0.0

RenderManyTrait for Yii Framework 2, allows render many views

  Sources   Download

MIT

The Requires

 

by Skliar Ihor

framework yii2 views render igogo5yo many

07/12 2015

1.1

1.1.0.0

RenderManyTrait for Yii Framework 2, allows render many views

  Sources   Download

MIT

The Requires

 

by Skliar Ihor

framework yii2 views render igogo5yo many

07/12 2015

1.0

1.0.0.0

RenderManyTrait for Yii Framework 2, allows render many views

  Sources   Download

MIT

The Requires

 

by Skliar Ihor

framework yii2 views render igogo5yo many