Download the PHP package gabidj/dot-controller without Composer

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

dot-controller

This package contains controller like middleware to be used inside a DotKernel or Expressive application. It provides base classes for action based controllers similar to ZF3 controller component. It is more lightweight though, but supports controller plugins.

Installation

Run the following composer command in your project directory

Merge the ConfigProvider to your configuration aggregate.

Usage

Middleware controllers act as a handler for multiple routes. Some conventions were made:

In order to create your action based controllers, you must extend the abstract class DotKernel\DotController\AbstractActionController

Example 1

Creating a UserController with default action and a register action. Will handle routes /user and /user/register

UserController.php

Then register this controller as a routed middleware in file routes.php just like a regular middleware.

Multiple controllers for the same route

Use case: You have defined a controller inside some package, with default actions. You want to add actions that fall into the same controller name(or route name more exactly). You want to do this without extending the controller provided by the package. In this case you can do the following

Now when a request for this route comes in, your controller will run first. DotKernel controllers are designed to ignore requests that cannot be matched to one of its methods, so if no action matches, it will call the next middleware, in our case, the second controller. If this is the last controller, and action does not match here, it will go to the default 404 Not found page(handled by NotFoundDelegate)

Controller plugins

Controllers support controller plugins, much like controllers in a ZF3 application. The module comes packed with a few common plugins, but you can extend controller functionality with your own plugins too.

Usage

Controller plugins must implement Dot\Controller\Plugin\PluginInterface. You can add them to the config file, at key ['dk_controller']['plugin_manager']. The design pattern uses the AbstractPluginManager provided by ZF3 service manager component. So, registration of a plugin under the aforementioned config key looks the same as the declaration of regular dependencies, as AbstractPluginManager actually extends ServiceManager.

Once registered, a plugin can be directly accessed in any controller, by calling a method with the plugin's name(the service name or the key at which the plugin is registered inside the manager)

Controller plugins offer the advantage of globally accessible functionality in any controller without to manually inject dependencies. Plugins should be used for functions that are common to any controller. Do not clutter controller's code with unnecessary plugins.

Example

Built-in plugins

Note: Each of these plugins requires the associated ZE packages to be installed and available in your project. Although these are optional, if a package is missing, the controller will not have the associated functionality available

Controller Events

// @TODO


All versions of dot-controller with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
psr/http-message Version ^1.0
http-interop/http-middleware Version ^0.4.1
zendframework/zend-servicemanager Version ^3.3.0
dotkernel/dot-event Version ^0.2
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 gabidj/dot-controller contains the following files

Loading the files please wait ....