2017 © Pedro Peláez
 

library nette-signals-trait

Learn any of your Nette components to understand signals!

image

vojtech-dobes/nette-signals-trait

Learn any of your Nette components to understand signals!

  • Tuesday, February 11, 2014
  • by vojtechdobes
  • Repository
  • 1 Watchers
  • 8 Stars
  • 36 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

For Nette Framework

Learn any of your components to understand signals!, (*1)

License

New BSD, (*2)

Dependencies
  • PHP 5.4
  • Nette 2.0.0

Installation

Get the source code from Github or via Composer (vojtech-dobes/nette-signals-trait)., (*3)

Usage

1.. Make your component (implementation of Nette\ComponentModel\IComponent) implement Nette\Application\UI\ISignalReceiver interface., (*4)

class AutocompleteField extends Nette\Forms\Controls\TextInput implements Nette\Application\UI\ISignalReceiver

2.. Use Nextras\Signals\Receiver trait in your component ., (*5)

use Nextras\Signals\Receiver;

3.. Register signals:, (*6)

public function __construct()
{
    $this->__signals()->addSignal('autocomplete', function (Nette\Application\UI\Presenter $presenter, $phrase) {
        $presenter->sendJson( ... );
    });
}

Now the component supports signal autocomplete, in same way as handleAutocomplete() method would work in your component inheriting Nette\Application\UI\Control., (*7)

You will probably also need to create link to it:, (*8)

$this->__signals()->createLink('autocomplete', 'testPhrase');

The Versions

11/02 2014

dev-master

9999999-dev http://github.com/vojtech-dobes/nette-signals-trait

Learn any of your Nette components to understand signals!

  Sources   Download

New BSD

The Requires

 

nette