Download the PHP package nubox/laminas-controller-injector without Composer

On this page you can find all versions of the php package nubox/laminas-controller-injector. 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 laminas-controller-injector

Laminas Controller Injector

Description

The core feature of this “plugin” is the ability to set parameters for controller methods. Primarily to pass the value of a variable of a route directly to the method at the dispatch event as an argument. The new AbstractInjectorController must be used for this usage.

In addition, with the new dispatcher you can also do without the “Action” postfix for these methods.

Requirements

Installation

Use composer to install the package:

composer require nubox/laminas-controller-injector

Activate Plugin in our Laminas Application

Usage

Suppose you have a controller that looks like this:

You can map routes to this controller method using the format controller::method and pass parameters from the routes directly into the method:

In the example above, the :param placeholder in the route gets passed directly as the $param argument to myMethod().

AbstractInjectorController

The provided \Laminas\Mvc\Injector\Controller\AbstractInjectorController is required as Controller extension. It matches the given parameter values into the requested action. The same variable name is required.

As soon as the AbstractInjectorController is used, in addition to the route parameters, objects from the ServiceManager are also injected into the corresponding controller method - regardless of the route. This reduces the processes necessary to access a service from the ServiceManager.

The respective request can also be injected as a complete request object.

Available ArgumentResolver -> (configurable controller_argument_resolver)

Every argument of a controller method is analyzed and can be determined by the activated ArgumentResolver. The following ArgumentResolvers are activated by default. However, additional ArgumentResolvers can also be added.

Activated by default:

Normally you need a corresponding type hint to determine the correct ArgumentResolver. In the event that no suitable type can be found, you can use the MarkUp interface NonTypeArgumentResolverInterface for your own ArgumentResolver. this would then also be “queried” in such a case.

Suggestion

Use nubox/laminas-router-attributes for reduce configuration overhead with symfony route attributes.


All versions of laminas-controller-injector with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0
laminas/laminas-modulemanager Version ^2.15
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 nubox/laminas-controller-injector contains the following files

Loading the files please wait ....