Download the PHP package dakujem/nette-wires without Composer

On this page you can find all versions of the php package dakujem/nette-wires. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nette-wires

Nette Wires

πŸ’Ώ composer require dakujem/nette-wires

SK sk_SK / CS cs_CZ

Wire Genie umoznuje redukovat "boilerplate" kod suvisiaci s drotovanim sluzieb cez prezentery (napriklad vytvaranie komponent a niektorych jednorazovych sluzieb typu builder alebo factory).

Ale bacha! 🀚

V zavislosti od konkretneho pouzitia moze dojst k poruseniu IoC principov a degradacii dependency injection principov na service locator. Pouzivajte na vlastnu zdpovednost, ak viete, co robite.

Na druhej strane, ak vytiahujete sluzby z kontajneru, mozete uz radsej pouzit Wire Genie.

Instalacia

πŸ’Ώ composer require dakujem/nette-wires

Tento metapackage instaluje Wire Genie a navod nizsie odporuca instalaciu Contributte/PSR-11-kontajner, ale mozete pouzit lubovolny iny PSR-11 wrapper Nette DI kontajneru.

Pokial si nainstalujete contributte/psr11-container-interface, mozete vo svojom bazovom prezenteri pouzit WireGenieTrait, ktory prida do prezenteru metodu wire.

composer require contributte/psr11-container-interface

πŸ’‘ Nepouzivajte traity, pokial nerozumiete, co s nimi nie je v poriadku.

Implementacia wire metody je inak vo vasich rukach.\ Namiesto nej mozete tiez priamo volat $wireGenie->provide( ... )->invoke( ... ).

Pouzitie

Metodu wire je mozne pouzit napriklad v createComponent* metodach:

Lepsie je zabalit kod do tovarne alebo populatoru (moznost testovat):

Lokalne zavislosti z prezenteru je mozne pribalit cez anonymne funkcie:

Tento postup umoznuje vyhnut sa injektovaniu mnozstva zavislosti do prezenterov, pokial nie su vzdy pouzivane (prezetner moze mat viacero akcii, pouzije sa len jedna; komponenty detto).

Taketo pouzitie Wire Genie riesi okrajovy pripad, kedy vznika boilerplate.\ Pred pouzitim skuste pouvazovat, ci sa vas pripad neda vyriesit cistejsie.\ Nette 3 podporuje injektovanie skupin sluzieb, SearchExtension umoznuje hromadne registrovat sluzby do kontajneru, atd.

Porovnajte vyhody a nevyhody:

Alternativne mozete skusit iny kompromis, napr. Kdyby/Autowired.

Osobne odporucam tieto techniky pouzivat len vo faze prototypovania.

EN en_GB

Allows to fetch multiple dependencies from a DI container and provide them as arguments to a callable.\ Metapackage.

Disclaimer 🀚

Depending on actual use, this might be breaking IoC and degrade your dependency injection container to a service locator, so use it with caution.

But then again, if you can get a service from your container, you can use wire genie.

Installation

πŸ’Ώ composer require dakujem/nette-wires

Then either install Contributte/PSR-11-kontajner or any other PSR-11 wrapper for Nette DI container.

If you install contributte/psr11-container-interface, you can use WireGenieTrait, in your presenter(s), that will add wire method.

composer require contributte/psr11-container-interface

πŸ’‘ Do not use traits unless you understand what's wrong with them.

Otherwise, implementation of wire method is in your hands.\ You can of course call $wireGenie->provide( ... )->invoke( ... ) directly as well.

Then you can wire dependencies without first labourously injecting them to your presenters, creating factories and accessors in the meantime.

Local dependencies can naturally be passed to the closures:

Please understand that this approach has its advantages and disadvantages. It might actually degrade your aplication if misused.\ First try to think if your case can not be solved in a cleaner way.\

I would recommend only using this and similar approaches during prototyping phase.


All versions of nette-wires with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
dakujem/wire-genie Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dakujem/nette-wires contains the following files

Loading the files please wait ....