2017 © Pedro Peláez
 

library nette-control-rendering

Multiple rendering modes for Control hierarchical structure with AJAX support.

image

dotblue/nette-control-rendering

Multiple rendering modes for Control hierarchical structure with AJAX support.

  • Thursday, March 5, 2015
  • by vojtechdobes
  • Repository
  • 7 Watchers
  • 10 Stars
  • 5,427 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Renderer of UI\Control

Requirements

Installation

Just copy source codes from Github or using Composer:, (*1)

$ composer require dotblue/nette-control-rendering@~1.0

Usage

If you want your custom component to support mode than default rendering mode, you can achieve that by writing more rendermethods, like this:, (*2)

public function render()
{
    ...
}

public function renderSmall()
{
    ...
}

In template, you can use the second rendering mode with colon notation:, (*3)

{control foo:small}

But this approach doesn't work well with AJAX. Also, sometimes your component consists of many subcomponents, but the whole hierarchical structure should have the same unified set of rendering modes. Imagine for example some data structure, which can be rendered as complex HTML or just a table, and you wish to implement each cell as component as well. Then not only the main component must have 2 rendering modes, but the cell subcomponents too., (*4)

That's what DotBlue\NetteControl\Renderer class is for. Just wrap your component in its factory method, and set proper rendering mode:, (*5)

use DotBlue\NetteControl\Renderer;

protected function createComponentFoo()
{
    return new Renderer(new Foo, 'small');
}

Now even if you use simple {control foo} in template, the renderSmall() method will be called for rendering. Including AJAX requests!, (*6)

But that's not all. All subcomponents of your Foo component will get wrapped by the same Renderer automatically too. So if they implement method renderSmall() as well, it will be used, and you don't need to specify that in template anywhere., (*7)

The Versions

05/03 2015

dev-master

9999999-dev

Multiple rendering modes for Control hierarchical structure with AJAX support.

  Sources   Download

BSD-3-Clause

The Requires

 

control nette rendering

12/05 2014

1.0.4

1.0.4.0

Multiple rendering modes for Control hierarchical structure with AJAX support.

  Sources   Download

BSD-3-Clause

The Requires

 

control nette rendering

12/05 2014

1.0.3

1.0.3.0

Multiple rendering modes for Control hierarchical structure with AJAX support.

  Sources   Download

BSD-3-Clause

The Requires

 

control nette rendering

22/04 2014

1.0.2

1.0.2.0

Multiple rendering modes for Control hierarchical structure with AJAX support.

  Sources   Download

BSD-3-Clause

The Requires

 

control nette rendering

07/04 2014

1.0.1

1.0.1.0

Multiple rendering modes for Control hierarchical structure with AJAX support.

  Sources   Download

BSD-3-Clause

The Requires

 

control nette rendering

05/04 2014

1.0.0

1.0.0.0

Multiple rendering modes for Control hierarchical structure with AJAX support.

  Sources   Download

BSD-3-Clause

The Requires

 

control nette rendering